diff --git a/source/blender/draw/engines/eevee_next/eevee_reflection_probes.cc b/source/blender/draw/engines/eevee_next/eevee_reflection_probes.cc index b0490ab4aaf..fcf338ba98d 100644 --- a/source/blender/draw/engines/eevee_next/eevee_reflection_probes.cc +++ b/source/blender/draw/engines/eevee_next/eevee_reflection_probes.cc @@ -13,7 +13,9 @@ namespace blender::eevee { void ReflectionProbeModule::init() { - if (probes_.is_empty()) { + if (!is_initialized) { + is_initialized = true; + ReflectionProbeData init_probe_data = {}; init_probe_data.layer = -1; for (int i : IndexRange(REFLECTION_PROBES_MAX)) { @@ -131,9 +133,13 @@ void ReflectionProbeModule::sync_object(Object *ob, ObjectHandle &ob_handle) probe.do_render |= is_dirty; probe.is_probe_used = true; - /* Only update data when rerendering the probes to reduce flickering. */ - if (!instance_.do_probe_sync()) { + const bool probe_sync_active = instance_.do_probe_sync(); + if (!probe_sync_active && is_dirty) { update_probes_next_sample_ = true; + } + + /* Only update data when rerendering the probes to reduce flickering. */ + if (!probe_sync_active) { return; } @@ -514,9 +520,7 @@ std::optional ReflectionProbeModule::update_info_pop( } /* Check reset probe updating as we completed rendering all Probes. */ - if (probe_type == ReflectionProbe::Type::Probe && update_probes_this_sample_ && - update_probes_next_sample_) - { + if (probe_type == ReflectionProbe::Type::Probe && update_probes_this_sample_) { update_probes_next_sample_ = false; } diff --git a/source/blender/draw/engines/eevee_next/eevee_reflection_probes.hh b/source/blender/draw/engines/eevee_next/eevee_reflection_probes.hh index d1134dc95f9..4e2042c54e0 100644 --- a/source/blender/draw/engines/eevee_next/eevee_reflection_probes.hh +++ b/source/blender/draw/engines/eevee_next/eevee_reflection_probes.hh @@ -95,6 +95,7 @@ class ReflectionProbeModule { static constexpr uint64_t world_object_key_ = 0; + bool is_initialized = false; Instance &instance_; ReflectionProbeDataBuf data_buf_; Map probes_;