summaryrefslogtreecommitdiff
path: root/game/scenary
diff options
context:
space:
mode:
Diffstat (limited to 'game/scenary')
-rw-r--r--game/scenary/foliage.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/game/scenary/foliage.cpp b/game/scenary/foliage.cpp
index 35be051..e54dfbd 100644
--- a/game/scenary/foliage.cpp
+++ b/game/scenary/foliage.cpp
@@ -34,6 +34,13 @@ Foliage::render(const SceneShader & shader) const
}
void
-Foliage::shadows(const ShadowMapper &) const
+Foliage::shadows(const ShadowMapper & mapper) const
{
+ if (const auto count = instances.count()) {
+ mapper.dynamicPointInst.use();
+ glBindVertexArray(instanceVAO);
+ glDrawElementsInstanced(
+ bodyMesh->type(), bodyMesh->count(), GL_UNSIGNED_INT, nullptr, static_cast<GLsizei>(count));
+ glBindVertexArray(0);
+ }
}