diff options
author | Dan Goodliffe <dan@randomdan.homeip.net> | 2023-04-22 19:06:42 +0100 |
---|---|---|
committer | Dan Goodliffe <dan@randomdan.homeip.net> | 2023-04-22 19:06:42 +0100 |
commit | d1f79b4c438ebf0822741e103b2cb06bdee4514e (patch) | |
tree | a4d574d12cd81d5e33886ce7ca961f7dbe872fcf /game/scenary/foliage.h | |
parent | Rename lots of shader files (diff) | |
parent | Keep the instance unused vector sorted and binary search it (diff) | |
download | ilt-d1f79b4c438ebf0822741e103b2cb06bdee4514e.tar.bz2 ilt-d1f79b4c438ebf0822741e103b2cb06bdee4514e.tar.xz ilt-d1f79b4c438ebf0822741e103b2cb06bdee4514e.zip |
Merge branch 'instancing'
Diffstat (limited to 'game/scenary/foliage.h')
-rw-r--r-- | game/scenary/foliage.h | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/game/scenary/foliage.h b/game/scenary/foliage.h index b85aab2..b72a9c2 100644 --- a/game/scenary/foliage.h +++ b/game/scenary/foliage.h @@ -1,19 +1,23 @@ #pragma once #include "assetFactory/asset.h" +#include "gfx/gl/instanceVertices.h" +#include "gfx/renderable.h" class SceneShader; class ShadowMapper; class Location; class Texture; -class Foliage : public Asset, public StdTypeDefs<Foliage> { +class Foliage : public Asset, public Renderable, public StdTypeDefs<Foliage> { Mesh::Ptr bodyMesh; std::shared_ptr<Texture> texture; + glVertexArray instanceVAO; public: - void render(const SceneShader &, const Location &) const; - void shadows(const ShadowMapper &, const Location &) const; + mutable InstanceVertices<glm::mat4> instances; + void render(const SceneShader &) const override; + void shadows(const ShadowMapper &) const override; protected: friend Persistence::SelectionPtrBase<std::shared_ptr<Foliage>>; |