From cf0cb625b2c79c76979555263eb97e4a70b46335 Mon Sep 17 00:00:00 2001 From: Dario Date: Mon, 22 Dec 2025 10:02:09 -0300 Subject: [PATCH] Fix real time reflection probes being constantly recreated. --- servers/rendering/renderer_rd/storage_rd/light_storage.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/servers/rendering/renderer_rd/storage_rd/light_storage.cpp b/servers/rendering/renderer_rd/storage_rd/light_storage.cpp index cc44e5081e1..0c7168578ab 100644 --- a/servers/rendering/renderer_rd/storage_rd/light_storage.cpp +++ b/servers/rendering/renderer_rd/storage_rd/light_storage.cpp @@ -1511,14 +1511,13 @@ bool LightStorage::reflection_probe_instance_begin_render(RID p_instance, RID p_ // but not the other way around. This can lead to situations where the reflection atlas will be stuck on a lower resolution // even if no real-time probes are present. This is intentional behavior until a future solution can accommodate for both // quality levels being used simultaneously. + const int required_real_time_mipmaps = 7; const bool switched_to_real_time = !atlas->update_always && update_always && atlas->reflection.is_valid(); - const bool real_time_mipmaps_different = update_always && atlas->reflection.is_valid() && atlas->reflections[0].data.layers[0].mipmaps.size() != 8; + const bool real_time_mipmaps_different = update_always && atlas->reflection.is_valid() && atlas->reflections[0].data.layers[0].mipmaps.size() != required_real_time_mipmaps; if (switched_to_real_time || real_time_mipmaps_different) { _reflection_atlas_clear(atlas); } - const int required_real_time_mipmaps = 7; - if (atlas->reflection.is_null()) { RendererRD::CopyEffects *copy_effects = RendererRD::CopyEffects::get_singleton(); ERR_FAIL_NULL_V_MSG(copy_effects, false, "Effects haven't been initialized");