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