Skip to content

Commit 63227bb

Browse files
authored
Merge pull request godotengine#114281 from DarioSamo/real-time-probe-fix
Fix real time reflection probes being constantly recreated.
2 parents 3b48b01 + cf0cb62 commit 63227bb

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

servers/rendering/renderer_rd/storage_rd/light_storage.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1511,14 +1511,13 @@ bool LightStorage::reflection_probe_instance_begin_render(RID p_instance, RID p_
15111511
// but not the other way around. This can lead to situations where the reflection atlas will be stuck on a lower resolution
15121512
// even if no real-time probes are present. This is intentional behavior until a future solution can accommodate for both
15131513
// quality levels being used simultaneously.
1514+
const int required_real_time_mipmaps = 7;
15141515
const bool switched_to_real_time = !atlas->update_always && update_always && atlas->reflection.is_valid();
1515-
const bool real_time_mipmaps_different = update_always && atlas->reflection.is_valid() && atlas->reflections[0].data.layers[0].mipmaps.size() != 8;
1516+
const bool real_time_mipmaps_different = update_always && atlas->reflection.is_valid() && atlas->reflections[0].data.layers[0].mipmaps.size() != required_real_time_mipmaps;
15161517
if (switched_to_real_time || real_time_mipmaps_different) {
15171518
_reflection_atlas_clear(atlas);
15181519
}
15191520

1520-
const int required_real_time_mipmaps = 7;
1521-
15221521
if (atlas->reflection.is_null()) {
15231522
RendererRD::CopyEffects *copy_effects = RendererRD::CopyEffects::get_singleton();
15241523
ERR_FAIL_NULL_V_MSG(copy_effects, false, "Effects haven't been initialized");

0 commit comments

Comments
 (0)