From d8464a28c6066931dd638653e2a082e2640191dc Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Wed, 18 Feb 2026 17:14:31 +0000 Subject: Fix up the preFrame process to use both frustums (camera and directional light frustums) This has made the whole preFrame process far more fiddly and repetitive than I'd like, but it does work. Maybe we can tidy it up later. --- ui/gameMainWindow.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'ui') diff --git a/ui/gameMainWindow.cpp b/ui/gameMainWindow.cpp index eec5512..9f224a2 100644 --- a/ui/gameMainWindow.cpp +++ b/ui/gameMainWindow.cpp @@ -85,12 +85,13 @@ GameMainWindow::handleInput(const SDL_Event & event) void GameMainWindow::render() { + const auto & [camFrust, lightFrust] = SceneRenderer::preFrame(gameState->environment->getSunPos()); for (const auto & [assetId, asset] : gameState->assets) { if (const auto renderable = asset.getAs()) { - renderable->preFrame(camera); + renderable->preFrame(camFrust, lightFrust); } } - gameState->world.apply(&Renderable::preFrame, camera); + gameState->world.apply(&Renderable::preFrame, camFrust, lightFrust); SceneRenderer::render(*this); glEnable(GL_BLEND); glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); -- cgit v1.3