From 382a4bad146745e00d4f2d46e957558d7c6dbfdd Mon Sep 17 00:00:00 2001 From: Julien Ignace Date: Tue, 12 May 2020 13:59:38 +0200 Subject: [PATCH 1/2] Put more information in Camera background type tooltip and fixed inconsistent exposure behavior when changing bg type. --- .../Editor/RenderPipeline/Camera/HDCameraUI.Skin.cs | 2 +- .../Runtime/RenderPipeline/Camera/HDCamera.cs | 9 +++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/Camera/HDCameraUI.Skin.cs b/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/Camera/HDCameraUI.Skin.cs index fa013832629..8d49a2a1568 100644 --- a/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/Camera/HDCameraUI.Skin.cs +++ b/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/Camera/HDCameraUI.Skin.cs @@ -13,7 +13,7 @@ static partial class HDCameraUI const string msaaWarningMessage = "Manual MSAA target set with deferred rendering. This will lead to undefined behavior."; - static readonly GUIContent clearModeContent = EditorGUIUtility.TrTextContent("Background Type", "Specifies the type of background the Camera applies when it clears the screen before rendering a frame."); + static readonly GUIContent clearModeContent = EditorGUIUtility.TrTextContent("Background Type", "Specifies the type of background the Camera applies when it clears the screen before rendering a frame. Be aware that when setting this to None, the background is never cleared and since HDRP shares render texture between cameras, you may end up with garbage from previous rendering."); static readonly GUIContent backgroundColorContent = EditorGUIUtility.TrTextContent("Background Color", "The Background Color used to clear the screen when selecting Background Color before rendering."); static readonly GUIContent cullingMaskContent = EditorGUIUtility.TrTextContent("Culling Mask"); static readonly GUIContent volumeLayerMaskContent = EditorGUIUtility.TrTextContent("Volume Layer Mask"); diff --git a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Camera/HDCamera.cs b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Camera/HDCamera.cs index a6f75a9e812..ac31a5d1dd3 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Camera/HDCamera.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Camera/HDCamera.cs @@ -262,6 +262,9 @@ internal HDAdditionalCameraData.ClearColorMode clearColorMode } } + HDAdditionalCameraData.ClearColorMode m_PreviousClearColorMode = HDAdditionalCameraData.ClearColorMode.None; + + internal Color backgroundColorHDR { get @@ -503,7 +506,7 @@ internal void SetReferenceSize() RTHandles.SetReferenceSize(actualWidth, actualHeight, msaaSamples); m_HistoryRTSystem.SwapAndSetReferenceSize(actualWidth, actualHeight, msaaSamples); } - + // Updating RTHandle needs to be done at the beginning of rendering (not during update of HDCamera which happens in batches) // The reason is that RTHandle will hold data necessary to setup RenderTargets and viewports properly. internal void BeginRender(CommandBuffer cmd) @@ -886,9 +889,11 @@ void UpdateAntialiasing() } // When changing antialiasing mode to TemporalAA we must reset the history, otherwise we get one frame of garbage - if (previousAntialiasing != antialiasing && antialiasing == AntialiasingMode.TemporalAntialiasing) + if ( (previousAntialiasing != antialiasing && antialiasing == AntialiasingMode.TemporalAntialiasing) + || (m_PreviousClearColorMode != clearColorMode)) { resetPostProcessingHistory = true; + m_PreviousClearColorMode = clearColorMode; } } From 7fd39b7b525b63f1fd25eb3feb17c621f74fafed Mon Sep 17 00:00:00 2001 From: Julien Ignace Date: Tue, 12 May 2020 14:00:10 +0200 Subject: [PATCH 2/2] Update changelog --- com.unity.render-pipelines.high-definition/CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/com.unity.render-pipelines.high-definition/CHANGELOG.md b/com.unity.render-pipelines.high-definition/CHANGELOG.md index e6d59ed0021..b48fd5b1c5e 100644 --- a/com.unity.render-pipelines.high-definition/CHANGELOG.md +++ b/com.unity.render-pipelines.high-definition/CHANGELOG.md @@ -581,6 +581,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - Fixed flickering of the game/scene view when lookdev is running. - Fixed issue with reflection probes in realtime time mode with OnEnable baking having wrong lighting with sky set to dynamic (case 1238047). - Fixed transparent motion vectors not working when in MSAA. +- Put more information in Camera background type tooltip and fixed inconsistent exposure behavior when changing bg type. ### Changed - Improve MIP selection for decals on Transparents