diff options
| author | Dan Goodliffe <dan@randomdan.homeip.net> | 2026-02-28 15:08:14 +0000 |
|---|---|---|
| committer | Dan Goodliffe <dan@randomdan.homeip.net> | 2026-02-28 15:08:14 +0000 |
| commit | 7d0aef9f4e3536110959e5b6b6da85f8750ac91e (patch) | |
| tree | 84bb22f4ab4e29d6d67f18b77a679f5c62e6b213 /game/scenary/foliage.h | |
| parent | Add BillboardProgram to SceneShader (diff) | |
| download | ilt-7d0aef9f4e3536110959e5b6b6da85f8750ac91e.tar.bz2 ilt-7d0aef9f4e3536110959e5b6b6da85f8750ac91e.tar.xz ilt-7d0aef9f4e3536110959e5b6b6da85f8750ac91e.zip | |
Billboard foliage
Partition the instances by within/without the view frustum, then by
proximity to the view point and within/without the sunlight shadow
frustum. Use billboards for far away/out of view instances.
Diffstat (limited to 'game/scenary/foliage.h')
| -rw-r--r-- | game/scenary/foliage.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/game/scenary/foliage.h b/game/scenary/foliage.h index d15a8b0..61bdb5b 100644 --- a/game/scenary/foliage.h +++ b/game/scenary/foliage.h @@ -1,6 +1,7 @@ #pragma once #include "assetFactory/asset.h" +#include "gfx/gl/billboardPainter.h" #include "gfx/gl/instanceVertices.h" #include "gfx/gl/shadowStenciller.h" #include "gfx/models/texture.h" @@ -26,13 +27,19 @@ public: }; mutable InstanceVertices<LocationVertex> instances; + void preFrame(const Frustum &, const Frustum &) override; void render(const SceneShader &, const Frustum &) const override; void shadows(const ShadowMapper &, const Frustum &) const override; void updateStencil(const ShadowStenciller &) const override; + void updateBillboard(const BillboardPainter &) const override; glTexture shadowStencil = ShadowStenciller::createStencilTexture(256, 256); + glTextures<3> billboard = BillboardPainter::createBillBoardTextures(256, 256); protected: friend Persistence::SelectionPtrBase<std::shared_ptr<Foliage>>; bool persist(Persistence::PersistenceStore & store) override; void postLoad() override; + +private: + InstanceVertices<Foliage::LocationVertex>::PartitionResult instancePartitions; }; |
