diff options
| author | Dan Goodliffe <dan.goodliffe@octal.co.uk> | 2026-02-18 17:14:31 +0000 |
|---|---|---|
| committer | Dan Goodliffe <dan@randomdan.homeip.net> | 2026-02-18 19:02:27 +0000 |
| commit | d8464a28c6066931dd638653e2a082e2640191dc (patch) | |
| tree | 18134e3ee51c9fd423b9395b90c3f19b6e54cfc3 /application | |
| parent | Add Renderable::preFrame for doing non-const frame prep work (diff) | |
| download | ilt-d8464a28c6066931dd638653e2a082e2640191dc.tar.bz2 ilt-d8464a28c6066931dd638653e2a082e2640191dc.tar.xz ilt-d8464a28c6066931dd638653e2a082e2640191dc.zip | |
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.
Diffstat (limited to 'application')
| -rw-r--r-- | application/resviewer.cpp | 17 |
1 files changed, 12 insertions, 5 deletions
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<const std::filesystem::path> fileList; std::filesystem::file_time_type fileTime; const std::filesystem::path * selectedFile {}; |
