diff --git a/com.unity.render-pipelines.core/Editor/LookDev/LookDevRenderer.cs b/com.unity.render-pipelines.core/Editor/LookDev/LookDevRenderer.cs index 6a9460a77c2..07a91f91a27 100644 --- a/com.unity.render-pipelines.core/Editor/LookDev/LookDevRenderer.cs +++ b/com.unity.render-pipelines.core/Editor/LookDev/LookDevRenderer.cs @@ -30,7 +30,6 @@ public void Dispose() return; disposed = true; - stage?.Dispose(); stage = null; updater = null; output?.Release(); diff --git a/com.unity.render-pipelines.core/Editor/LookDev/Stage.cs b/com.unity.render-pipelines.core/Editor/LookDev/Stage.cs index 0d96a34a421..0679af9f6f1 100644 --- a/com.unity.render-pipelines.core/Editor/LookDev/Stage.cs +++ b/com.unity.render-pipelines.core/Editor/LookDev/Stage.cs @@ -196,7 +196,7 @@ static void InitAddedObjectsRecursively(GameObject go) var lineRenderer = go.GetComponent(); if (lineRenderer != null) lineRenderer.lightProbeUsage = UnityEngine.Rendering.LightProbeUsage.Off; - + var volumes = go.GetComponents(); foreach (var volume in volumes) volume.UpdateLayer(); //force update of layer now as the Update can be called after we unregister volume from manager @@ -273,6 +273,7 @@ class StageCache : IDisposable Stage[] m_Stages; Context m_Contexts; + IDataProvider m_CurrentDataProvider; public Stage this[ViewIndex index] => m_Stages[(int)index]; @@ -310,6 +311,8 @@ Stage InitStage(ViewIndex index, IDataProvider dataProvider) } dataProvider.FirstInitScene(stage.runtimeInterface); + + m_CurrentDataProvider = dataProvider; return stage; } @@ -345,7 +348,10 @@ void CleanUp() if (!disposedValue) { foreach (Stage stage in m_Stages) + { + m_CurrentDataProvider.Cleanup(stage.runtimeInterface); stage.Dispose(); + } disposedValue = true; } diff --git a/com.unity.render-pipelines.core/Runtime/LookDev/IDataProvider.cs b/com.unity.render-pipelines.core/Runtime/LookDev/IDataProvider.cs index 447823bdb8b..8f5c7750840 100644 --- a/com.unity.render-pipelines.core/Runtime/LookDev/IDataProvider.cs +++ b/com.unity.render-pipelines.core/Runtime/LookDev/IDataProvider.cs @@ -46,6 +46,12 @@ public interface IDataProvider /// /// Access element of the LookDev's scene void OnEndRendering(StageRuntimeInterface stage); + + /// + /// Callback called to do any necessary cleanup. + /// + /// Access element of the LookDev's scene + void Cleanup(StageRuntimeInterface SRI); } /// diff --git a/com.unity.render-pipelines.core/Runtime/Textures/RTHandleSystem.cs b/com.unity.render-pipelines.core/Runtime/Textures/RTHandleSystem.cs index 52fc284e6ed..8a764aa9ad9 100644 --- a/com.unity.render-pipelines.core/Runtime/Textures/RTHandleSystem.cs +++ b/com.unity.render-pipelines.core/Runtime/Textures/RTHandleSystem.cs @@ -185,7 +185,7 @@ public void SetReferenceSize(int width, int height, MSAASamples msaaSamples, boo lastFrameMaxSize = new Vector2(GetMaxWidth(), GetMaxHeight()); } - if (DynamicResolutionHandler.instance.HardwareDynamicResIsEnabled()) + if (DynamicResolutionHandler.instance.HardwareDynamicResIsEnabled() && m_HardwareDynamicResRequested) { m_RTHandleProperties.rtHandleScale = new Vector4(1.0f, 1.0f, 1.0f, 1.0f); } diff --git a/com.unity.render-pipelines.high-definition/CHANGELOG.md b/com.unity.render-pipelines.high-definition/CHANGELOG.md index bd06e20281e..710527d6bb8 100644 --- a/com.unity.render-pipelines.high-definition/CHANGELOG.md +++ b/com.unity.render-pipelines.high-definition/CHANGELOG.md @@ -9,6 +9,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ### Fixed - Fixed issue in Material Postprocess which may fail due to empty SubAsset. - Fixed a null ref exception when baking reflection probes. +- Fixed TAA issue and hardware dynamic resolution. +- Fixed an issue where look dev lighting would go black when a new scene is loaded. ## [8.2.0] - 2020-07-08 diff --git a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.LookDev.cs b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.LookDev.cs index 1d3aa84ec17..a2d41634420 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.LookDev.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.LookDev.cs @@ -33,6 +33,7 @@ bool UpdateVolumeProfile(Volume volume, out VisualEnvironment visualEnvironment, m_LookDevVolumeProfileHash = newHashCode; VolumeProfile profile = ScriptableObject.Instantiate(hdrpAsset.defaultLookDevProfile); + profile.hideFlags = HideFlags.HideAndDontSave; volume.sharedProfile = profile; // Remove potentially existing components in the user profile. @@ -238,5 +239,11 @@ void IDataProvider.GetShadowMask(ref RenderTexture output, StageRuntimeInterface data.additionalCameraData.backgroundColorHDR = oldBackgroundColor; data.additionalCameraData.clearColorMode = oldClearMode; } + + void IDataProvider.Cleanup(StageRuntimeInterface SRI) + { + LookDevDataForHDRP data = (LookDevDataForHDRP)SRI.SRPData; + CoreUtils.Destroy(data.volume.sharedProfile); + } } }