Skip to content

Commit 03de1f2

Browse files
authored
GFXGI-237: Force update for static skies when camera type is set to SceneView (#1570)
1 parent 4426bb1 commit 03de1f2

File tree

1 file changed

+4
-2
lines changed
  • com.unity.render-pipelines.high-definition/Runtime/Sky

1 file changed

+4
-2
lines changed

com.unity.render-pipelines.high-definition/Runtime/Sky/SkyManager.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -823,8 +823,10 @@ public void UpdateEnvironment(HDCamera hdCamera, ScriptableRenderContext renderC
823823
StaticLightingSky staticLightingSky = GetStaticLightingSky();
824824
#if UNITY_EDITOR
825825
// In the editor, we might need the static sky ready for baking lightmaps/lightprobes regardless of the current ambient mode so we force it to update in this case if it's not been computed yet..
826-
// We don't test if the hash of the static sky has changed here because it depends on the sun direction and in the case of LookDev, sun will be different from the main rendering so it will induce improper recomputation.
827-
forceStaticUpdate = staticLightingSky != null && m_StaticLightingSky.skyParametersHash == -1;
826+
// We always force an update of the static sky when we're in scene view mode. Previous behaviour was to prevent forced updates if the hash of the static sky was non-null, but this was preventing
827+
// the lightmapper from updating in response to changes in environment. See GFXGI-237 for a better description of this issue.
828+
829+
forceStaticUpdate = hdCamera.camera.cameraType == CameraType.SceneView;
828830
#endif
829831
if ((ambientMode == SkyAmbientMode.Static || forceStaticUpdate) && hdCamera.camera.cameraType != CameraType.Preview)
830832
{

0 commit comments

Comments
 (0)