From 362c6952742eb01e32fdeb2ec26a2fe463e5001c Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Mon, 26 Aug 2024 13:47:22 +0100 Subject: Add a foliage vertex array for just the location data --- game/scenary/foliage.cpp | 2 ++ game/scenary/foliage.h | 1 + 2 files changed, 3 insertions(+) (limited to 'game/scenary') diff --git a/game/scenary/foliage.cpp b/game/scenary/foliage.cpp index 13d2f3b..1c03217 100644 --- a/game/scenary/foliage.cpp +++ b/game/scenary/foliage.cpp @@ -16,6 +16,8 @@ Foliage::postLoad() texture = getTexture(); bodyMesh->configureVAO(instanceVAO) .addAttribs(instances.bufferName(), 1); + VertexArrayObject {instancePointVAO}.addAttribs( + instances.bufferName()); } void diff --git a/game/scenary/foliage.h b/game/scenary/foliage.h index fa6c63b..824a644 100644 --- a/game/scenary/foliage.h +++ b/game/scenary/foliage.h @@ -14,6 +14,7 @@ class Foliage : public Asset, public Renderable, public StdTypeDefs { Mesh::Ptr bodyMesh; Texture::Ptr texture; glVertexArray instanceVAO; + glVertexArray instancePointVAO; public: using LocationVertex = std::pair; -- cgit v1.2.3