diff options
author | Dan Goodliffe <dan@randomdan.homeip.net> | 2023-04-20 20:27:43 +0100 |
---|---|---|
committer | Dan Goodliffe <dan@randomdan.homeip.net> | 2023-04-20 20:27:43 +0100 |
commit | ac05fbbc71282b059164b51efd68ee6e372870cb (patch) | |
tree | a505ed3e38a8e2419c1d706f45dd39873b627962 /ui/gameMainWindow.cpp | |
parent | Expose bufferName and count from InstanceVertices (diff) | |
download | ilt-ac05fbbc71282b059164b51efd68ee6e372870cb.tar.bz2 ilt-ac05fbbc71282b059164b51efd68ee6e372870cb.tar.xz ilt-ac05fbbc71282b059164b51efd68ee6e372870cb.zip |
Switch to render trees in bulk through foliage asset rendering
Diffstat (limited to 'ui/gameMainWindow.cpp')
-rw-r--r-- | ui/gameMainWindow.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/ui/gameMainWindow.cpp b/ui/gameMainWindow.cpp index 0b30cad..3f85a4f 100644 --- a/ui/gameMainWindow.cpp +++ b/ui/gameMainWindow.cpp @@ -51,6 +51,11 @@ GameMainWindow::render() const void GameMainWindow::content(const SceneShader & shader) const { + for (const auto & [id, asset] : gameState->assets) { + if (const auto r = std::dynamic_pointer_cast<const Renderable>(asset)) { + r->render(shader); + } + } gameState->world.apply<Renderable>(&Renderable::render, shader); uiComponents.apply<WorldOverlay>(&WorldOverlay::render, shader); } @@ -68,5 +73,10 @@ GameMainWindow::lights(const SceneShader & shader) const void GameMainWindow::shadows(const ShadowMapper & shadowMapper) const { + for (const auto & [id, asset] : gameState->assets) { + if (const auto r = std::dynamic_pointer_cast<const Renderable>(asset)) { + r->shadows(shadowMapper); + } + } gameState->world.apply<Renderable>(&Renderable::shadows, shadowMapper); } |