summaryrefslogtreecommitdiff
path: root/game/scenary/foliage.h
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2023-04-20 20:27:43 +0100
committerDan Goodliffe <dan@randomdan.homeip.net>2023-04-20 20:27:43 +0100
commitac05fbbc71282b059164b51efd68ee6e372870cb (patch)
treea505ed3e38a8e2419c1d706f45dd39873b627962 /game/scenary/foliage.h
parentExpose bufferName and count from InstanceVertices (diff)
downloadilt-ac05fbbc71282b059164b51efd68ee6e372870cb.tar.bz2
ilt-ac05fbbc71282b059164b51efd68ee6e372870cb.tar.xz
ilt-ac05fbbc71282b059164b51efd68ee6e372870cb.zip
Switch to render trees in bulk through foliage asset rendering
Diffstat (limited to 'game/scenary/foliage.h')
-rw-r--r--game/scenary/foliage.h10
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>>;