Fix: EEVEE-Next: Planar Probes First Sample

When the first planar probe is added to the scene, or the last probe
is removed from the scene the samples needs to be reset. This removes
artifacts when only a single sample is used.

Pull Request: https://projects.blender.org/blender/blender/pulls/113440
This commit is contained in:
Jeroen Bakker 2023-10-09 14:49:49 +02:00
parent ed3eaff968
commit f6df5d3514
1 changed files with 7 additions and 5 deletions

View File

@ -13,7 +13,9 @@ namespace blender::eevee {
void PlanarProbeModule::init()
{
update_probes_ = !probes_.is_empty();
if (assign_if_different(update_probes_, !probes_.is_empty())) {
instance_.sampling.reset();
}
}
void PlanarProbeModule::begin_sync()
@ -43,10 +45,10 @@ void PlanarProbeModule::end_sync()
{
remove_unused_probes();
// if (probes_.is_empty()) {
// update_probes_ = true;
// instance_.sampling.reset();
// }
/* When first planar probes are enabled it can happen that the first sample is off. */
if (!update_probes_ && !probes_.is_empty()) {
DRW_viewport_request_redraw();
}
}
float4x4 PlanarProbeModule::reflection_matrix_get(const float4x4 &plane_to_world,