Skip to content

Commit 5abb1ca

Browse files
New tooltip for camera background and fixed exposure when switching the background mode. (#415)
* Put more information in Camera background type tooltip and fixed inconsistent exposure behavior when changing bg type. * Update changelog Co-authored-by: sebastienlagarde <[email protected]>
1 parent 8787a98 commit 5abb1ca

File tree

3 files changed

+9
-3
lines changed

3 files changed

+9
-3
lines changed

com.unity.render-pipelines.high-definition/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -598,6 +598,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
598598
- Fixed assert on tests caused by probe culling results being requested when culling did not happen. (case 1246169)
599599
- Fixed over consumption of GPU memory by the Physically Based Sky.
600600
- Fixed an invalid rotation in Planar Reflection Probe editor display, that was causing an error message (case 1182022)
601+
- Put more information in Camera background type tooltip and fixed inconsistent exposure behavior when changing bg type.
601602

602603
### Changed
603604
- Improve MIP selection for decals on Transparents

com.unity.render-pipelines.high-definition/Editor/RenderPipeline/Camera/HDCameraUI.Skin.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ static partial class HDCameraUI
1313

1414
const string msaaWarningMessage = "Manual MSAA target set with deferred rendering. This will lead to undefined behavior.";
1515

16-
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.");
16+
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.");
1717
static readonly GUIContent backgroundColorContent = EditorGUIUtility.TrTextContent("Background Color", "The Background Color used to clear the screen when selecting Background Color before rendering.");
1818
static readonly GUIContent cullingMaskContent = EditorGUIUtility.TrTextContent("Culling Mask");
1919
static readonly GUIContent volumeLayerMaskContent = EditorGUIUtility.TrTextContent("Volume Layer Mask");

com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Camera/HDCamera.cs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -264,6 +264,9 @@ internal HDAdditionalCameraData.ClearColorMode clearColorMode
264264
}
265265
}
266266

267+
HDAdditionalCameraData.ClearColorMode m_PreviousClearColorMode = HDAdditionalCameraData.ClearColorMode.None;
268+
269+
267270
internal Color backgroundColorHDR
268271
{
269272
get
@@ -505,7 +508,7 @@ internal void SetReferenceSize()
505508
RTHandles.SetReferenceSize(actualWidth, actualHeight, msaaSamples);
506509
m_HistoryRTSystem.SwapAndSetReferenceSize(actualWidth, actualHeight, msaaSamples);
507510
}
508-
511+
509512
// Updating RTHandle needs to be done at the beginning of rendering (not during update of HDCamera which happens in batches)
510513
// The reason is that RTHandle will hold data necessary to setup RenderTargets and viewports properly.
511514
internal void BeginRender(CommandBuffer cmd)
@@ -888,9 +891,11 @@ void UpdateAntialiasing()
888891
}
889892

890893
// When changing antialiasing mode to TemporalAA we must reset the history, otherwise we get one frame of garbage
891-
if (previousAntialiasing != antialiasing && antialiasing == AntialiasingMode.TemporalAntialiasing)
894+
if ( (previousAntialiasing != antialiasing && antialiasing == AntialiasingMode.TemporalAntialiasing)
895+
|| (m_PreviousClearColorMode != clearColorMode))
892896
{
893897
resetPostProcessingHistory = true;
898+
m_PreviousClearColorMode = clearColorMode;
894899
}
895900
}
896901

0 commit comments

Comments
 (0)