|
@@ -1385,7 +1385,7 @@ bool LightStorage::shadow_atlas_update_light(RID p_atlas, RID p_light_instance,
|
|
|
old_shadow = old_key & SHADOW_INDEX_MASK;
|
|
|
|
|
|
// Only re-allocate if a better option is available, and enough time has passed.
|
|
|
- should_realloc = shadow_atlas->quadrants[old_quadrant].subdivision != (uint32_t)best_subdiv && (shadow_atlas->quadrants[old_quadrant].shadows[old_shadow].alloc_tick - tick > shadow_atlas_realloc_tolerance_msec);
|
|
|
+ should_realloc = shadow_atlas->quadrants[old_quadrant].subdivision != (uint32_t)best_subdiv && (tick - shadow_atlas->quadrants[old_quadrant].shadows[old_shadow].alloc_tick > shadow_atlas_realloc_tolerance_msec);
|
|
|
should_redraw = shadow_atlas->quadrants[old_quadrant].shadows[old_shadow].version != p_light_version;
|
|
|
|
|
|
if (!should_realloc) {
|