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. --- application/resviewer.cpp | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) (limited to 'application') diff --git a/application/resviewer.cpp b/application/resviewer.cpp index e0c36f6..0e34c05 100644 --- a/application/resviewer.cpp +++ b/application/resviewer.cpp @@ -44,8 +44,9 @@ private: void render() override { + const auto & [camFrust, lightFrust] = preFrame(gameState->environment->getSunPos()); SceneRenderer::render(*this); - controls(); + controls(camFrust, lightFrust); } void @@ -89,12 +90,12 @@ private: } void - controls() + controls(const Frustum & camFrust, const Frustum & lightFrust) { if (ImGui::Begin("Resource view")) { ImGui::SetWindowSize({}); fileSelection(); - assetSelection(); + assetSelection(camFrust, lightFrust); } ImGui::End(); @@ -130,7 +131,7 @@ private: } void - assetSelection() + assetSelection(const Frustum & camFrust, const Frustum & lightFrust) { if (!gameState->assets.empty()) { ImGui::BeginListBox("Asset"); @@ -141,7 +142,7 @@ private: selectedAssetId = asset.first; selectedAsset = renderable; location = asset.second->createAt(position); - renderable->preFrame(camera); + renderable->preFrame(camFrust, lightFrust); } } } @@ -175,6 +176,12 @@ private: } } + void + environment(const SceneShader &, const SceneRenderer & renderer) const override + { + gameState->environment->render(renderer, *this); + } + std::span fileList; std::filesystem::file_time_type fileTime; const std::filesystem::path * selectedFile {}; -- cgit v1.3