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 --- ui/gameMainWindow.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'ui/gameMainWindow.cpp') 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(asset)) { + r->render(shader); + } + } gameState->world.apply(&Renderable::render, shader); uiComponents.apply(&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(asset)) { + r->shadows(shadowMapper); + } + } gameState->world.apply(&Renderable::shadows, shadowMapper); } -- cgit v1.2.3