diff --git a/com.unity.render-pipelines.high-definition/CHANGELOG.md b/com.unity.render-pipelines.high-definition/CHANGELOG.md index ce4de18c909..6a75f6e3e56 100644 --- a/com.unity.render-pipelines.high-definition/CHANGELOG.md +++ b/com.unity.render-pipelines.high-definition/CHANGELOG.md @@ -13,6 +13,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - Made more explicit the warning about raytracing and asynchronous compute. Also fixed the condition in which it appears. - Fixed a null ref exception in static sky when the default volume profile is invalid. - Fixed an error about procedural sky being logged by mistake. +- Fixed flickering of the game/scene view when lookdev is running. ### Changed - Shadowmask and realtime reflection probe property are hide in Quality settings diff --git a/com.unity.render-pipelines.high-definition/Runtime/Sky/SkyManager.cs b/com.unity.render-pipelines.high-definition/Runtime/Sky/SkyManager.cs index 52bb03f685c..1192bc4e189 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Sky/SkyManager.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/Sky/SkyManager.cs @@ -697,7 +697,7 @@ public void UpdateEnvironment( HDCamera hdCamera, // This is to avoid cases in which the probe camera is below ground and the parent is not, leading to // in case of PBR sky to a black sky. All other parameters are left as is. // This can introduce inaccuracies, but they should be acceptable if the distance parent camera - probe camera is - // small. + // small. if (hdCamera.camera.cameraType == CameraType.Reflection && hdCamera.parentCamera != null) { worldSpaceCameraPos = hdCamera.parentCamera.transform.position; @@ -794,13 +794,14 @@ public void UpdateEnvironment(HDCamera hdCamera, ScriptableRenderContext renderC // because we only maintain one static sky. Since we don't care that the static lighting may be a bit different in the preview we never recompute // and we use the one from the main camera. bool forceStaticUpdate = false; + StaticLightingSky staticLightingSky = GetStaticLightingSky(); #if UNITY_EDITOR - // 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. - forceStaticUpdate = true; + // 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.. + // 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. + forceStaticUpdate = staticLightingSky != null && m_StaticLightingSky.skyParametersHash == -1; ; #endif if ((ambientMode == SkyAmbientMode.Static || forceStaticUpdate) && hdCamera.camera.cameraType != CameraType.Preview) { - StaticLightingSky staticLightingSky = GetStaticLightingSky(); if (staticLightingSky != null) { m_StaticLightingSky.skySettings = staticLightingSky.skySettings;