From ac05fbbc71282b059164b51efd68ee6e372870cb Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Thu, 20 Apr 2023 20:27:43 +0100 Subject: Switch to render trees in bulk through foliage asset rendering --- game/scenary/foliage.h | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'game/scenary/foliage.h') 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 { +class Foliage : public Asset, public Renderable, public StdTypeDefs { Mesh::Ptr bodyMesh; std::shared_ptr texture; + glVertexArray instanceVAO; public: - void render(const SceneShader &, const Location &) const; - void shadows(const ShadowMapper &, const Location &) const; + mutable InstanceVertices instances; + void render(const SceneShader &) const override; + void shadows(const ShadowMapper &) const override; protected: friend Persistence::SelectionPtrBase>; -- cgit v1.2.3