From ec76a4d64740f945335eb07a8bab8f8c46b297f4 Mon Sep 17 00:00:00 2001 From: dmcdiarmid-ly <63674186+dmcdiarmid-ly@users.noreply.github.com> Date: Sat, 29 Jan 2022 20:59:22 -0700 Subject: [PATCH] Always relocate probes after the texture is cleared Signed-off-by: dmcdiarmid-ly <63674186+dmcdiarmid-ly@users.noreply.github.com> --- .../DiffuseGlobalIllumination/DiffuseProbeGrid.cpp | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGrid.cpp b/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGrid.cpp index b04078c893..ac7d4bbb4d 100644 --- a/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGrid.cpp +++ b/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGrid.cpp @@ -121,9 +121,6 @@ namespace AZ // recompute the number of probes since the spacing changed UpdateProbeCount(); - // probes need to be relocated since the grid density changed - m_remainingRelocationIterations = DefaultNumRelocationIterations; - m_updateTextures = true; } @@ -174,9 +171,6 @@ namespace AZ m_obbWs = Obb::CreateFromPositionRotationAndHalfLengths(m_transform.GetTranslation(), m_transform.GetRotation(), m_renderExtents / 2.0f); - // probes need to be relocated since the grid extents changed - m_remainingRelocationIterations = DefaultNumRelocationIterations; - m_updateTextures = true; } @@ -206,9 +200,6 @@ namespace AZ } m_updateTextures = true; - - // probes need to be relocated since the mode has changed - m_remainingRelocationIterations = DefaultNumRelocationIterations; } void DiffuseProbeGrid::SetBakedTextures(const DiffuseProbeGridBakedTextures& bakedTextures) @@ -363,6 +354,9 @@ namespace AZ [[maybe_unused]] RHI::ResultCode result = m_renderData->m_imagePool->InitImage(request); AZ_Assert(result == RHI::ResultCode::Success, "Failed to initialize m_probeDataImage image"); } + + // probes need to be relocated since the textures changed + m_remainingRelocationIterations = DefaultNumRelocationIterations; } m_updateTextures = false;