summaryrefslogtreecommitdiff
path: root/game/scenary/foliage.h
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2023-04-22 19:06:42 +0100
committerDan Goodliffe <dan@randomdan.homeip.net>2023-04-22 19:06:42 +0100
commitd1f79b4c438ebf0822741e103b2cb06bdee4514e (patch)
treea4d574d12cd81d5e33886ce7ca961f7dbe872fcf /game/scenary/foliage.h
parentRename lots of shader files (diff)
parentKeep the instance unused vector sorted and binary search it (diff)
downloadilt-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.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>>;