diff --git a/com.unity.render-pipelines.high-definition/CHANGELOG.md b/com.unity.render-pipelines.high-definition/CHANGELOG.md index bec49242c80..64645843a27 100644 --- a/com.unity.render-pipelines.high-definition/CHANGELOG.md +++ b/com.unity.render-pipelines.high-definition/CHANGELOG.md @@ -529,6 +529,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - Fixed various object leaks in HDRP. - Fixed compile error with XR SubsystemManager. - Fix for assertion triggering sometimes when saving a newly created lit shader graph (case 1230996) +- Fixed culling of planar reflection probes that change position (case 1218651) ### Changed - Color buffer pyramid is not allocated anymore if neither refraction nor distortion are enabled diff --git a/com.unity.render-pipelines.high-definition/Runtime/Lighting/Reflection/HDProbeSystem.cs b/com.unity.render-pipelines.high-definition/Runtime/Lighting/Reflection/HDProbeSystem.cs index 4dab12b248a..5a2bcc6dac5 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Lighting/Reflection/HDProbeSystem.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/Lighting/Reflection/HDProbeSystem.cs @@ -246,7 +246,7 @@ internal HDProbeCullState PrepareCull(Camera camera) if (m_PlanarProbeCullingGroup == null) return default; - RemoveDestroyedProbes(m_PlanarProbes, m_PlanarProbeBounds, ref m_PlanarProbeCount); + UpdateBoundsAndRemoveDestroyedProbes(m_PlanarProbes, m_PlanarProbeBounds, ref m_PlanarProbeCount); m_PlanarProbeCullingGroup.targetCamera = camera; m_PlanarProbeCullingGroup.SetBoundingSpheres(m_PlanarProbeBounds); @@ -286,7 +286,7 @@ static void RemoveDestroyedProbes(List probes) } } - static void RemoveDestroyedProbes(PlanarReflectionProbe[] probes, BoundingSphere[] bounds, ref int count) + static void UpdateBoundsAndRemoveDestroyedProbes(PlanarReflectionProbe[] probes, BoundingSphere[] bounds, ref int count) { for (int i = 0; i < count; ++i) { @@ -297,6 +297,11 @@ static void RemoveDestroyedProbes(PlanarReflectionProbe[] probes, BoundingSphere probes[count - 1] = null; --count; } + + if (probes[i]) + { + bounds[i] = probes[i].boundingSphere; + } } }