Skip to content

Commit b2714f1

Browse files
i9neussebastienlagarde
authored andcommitted
GFXGI-237: Force update for static skies when camera type is set to S… #1570
1 parent 867114d commit b2714f1

File tree

2 files changed

+1093
-2
lines changed

2 files changed

+1093
-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
@@ -815,8 +815,10 @@ public void UpdateEnvironment(HDCamera hdCamera, ScriptableRenderContext renderC
815815
StaticLightingSky staticLightingSky = GetStaticLightingSky();
816816
#if UNITY_EDITOR
817817
// 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..
818-
// 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.
819-
forceStaticUpdate = staticLightingSky != null && m_StaticLightingSky.skyParametersHash == -1; ;
818+
// 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
819+
// the lightmapper from updating in response to changes in environment. See GFXGI-237 for a better description of this issue.
820+
821+
forceStaticUpdate = hdCamera.camera.cameraType == CameraType.SceneView;
820822
#endif
821823
if ((ambientMode == SkyAmbientMode.Static || forceStaticUpdate) && hdCamera.camera.cameraType != CameraType.Preview)
822824
{

0 commit comments

Comments
 (0)