From 76503e9f5bf008b7f58d7fed0dda0d923f40fbde Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tur=C3=A1nszki=20J=C3=A1nos?= Date: Fri, 6 Mar 2026 07:46:29 +0100 Subject: [PATCH] fix: ocean is not rendered for fallback probe --- WickedEngine/wiRenderer.cpp | 22 +++++++++++----------- WickedEngine/wiVersion.cpp | 2 +- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/WickedEngine/wiRenderer.cpp b/WickedEngine/wiRenderer.cpp index 22cabe475..fd56d43d1 100644 --- a/WickedEngine/wiRenderer.cpp +++ b/WickedEngine/wiRenderer.cpp @@ -9130,6 +9130,7 @@ void RefreshEnvProbes(const Visibility& vis, CommandList cmd) auto render_probe = [&](const EnvironmentProbeComponent& probe, const AABB& probe_aabb) { + const bool valid_probe = probe_aabb.layerMask & vis.layerMask; // if hand placed probe and passes layer check, objects and other things can be rendered into it, otherwise filled with sky only const float zNearP = vis.camera->zNearP; const float zFarP = probe.view_distance < 0 ? vis.camera->zFarP : probe.view_distance; const float zNearPRcp = 1.0f / zNearP; @@ -9185,7 +9186,7 @@ void RefreshEnvProbes(const Visibility& vis, CommandList cmd) thread_local wi::vector visible_gaussian_models; visible_gaussian_models.clear(); - if (probe_aabb.layerMask & vis.layerMask && vis.scene->gaussian_scene.IsValid()) + if (valid_probe && vis.scene->gaussian_scene.IsValid()) { XMFLOAT4X4 viewmatrices[arraysize(cameras)]; for (uint32_t i = 0; i < arraysize(cameras); ++i) @@ -9431,7 +9432,7 @@ void RefreshEnvProbes(const Visibility& vis, CommandList cmd) } // Scene will only be rendered if this is a real probe entity: - if (probe_aabb.layerMask & vis.layerMask) + if (valid_probe) { renderQueue.init(); for (size_t i = 0; i < vis.scene->aabb_objects.size(); ++i) @@ -9482,16 +9483,15 @@ void RefreshEnvProbes(const Visibility& vis, CommandList cmd) device->DrawInstanced(240, 6, 0, 0, cmd); // 6 instances so it will be replicated for every cubemap face } - if (vis.scene->ocean.IsValid() && vis.scene->weather.IsOceanEnabled()) + if (valid_probe) // only draw these if this is a hand placed probe { - ForwardEntityMaskCB cb = ForwardEntityCullingCPU(vis, vis.scene->ocean.GetAABB(probe.position)); - device->BindDynamicConstantBuffer(cb, CB_GETBINDSLOT(ForwardEntityMaskCB), cmd); + if (vis.scene->ocean.IsValid() && vis.scene->weather.IsOceanEnabled()) + { + ForwardEntityMaskCB cb = ForwardEntityCullingCPU(vis, vis.scene->ocean.GetAABB(probe.position)); + device->BindDynamicConstantBuffer(cb, CB_GETBINDSLOT(ForwardEntityMaskCB), cmd); - vis.scene->ocean.RenderForCubemap(cmd); - } - - if (probe_aabb.layerMask & vis.layerMask) // only draw these if this is a hand placed probe - { + vis.scene->ocean.RenderForCubemap(cmd); + } if (!visible_gaussian_models.empty()) { vis.scene->gaussian_scene.Draw(cmd, 6); // 6 instances so it will be replicated for every cubemap face @@ -9540,7 +9540,7 @@ void RefreshEnvProbes(const Visibility& vis, CommandList cmd) push.filterResolution_rcp.x = 1.0f / push.filterResolution.x; push.filterResolution_rcp.y = 1.0f / push.filterResolution.y; push.filterRoughness = (float)i / (float)(desc.mip_levels - 1); - if (probe_aabb.layerMask & vis.layerMask) + if (valid_probe) { // real probe: if (probe.IsRealTime()) diff --git a/WickedEngine/wiVersion.cpp b/WickedEngine/wiVersion.cpp index f350a4478..ad9399483 100644 --- a/WickedEngine/wiVersion.cpp +++ b/WickedEngine/wiVersion.cpp @@ -9,7 +9,7 @@ namespace wi::version // minor features, major updates, breaking compatibility changes const int minor = 72; // minor bug fixes, alterations, refactors, updates - const int revision = 54; + const int revision = 55; const std::string version_string = std::to_string(major) + "." + std::to_string(minor) + "." + std::to_string(revision);