Skip to content

Commit 5dae334

Browse files
remi-chapelainEvergreen
authored andcommitted
[HDRP] Fix lens flare screen space and bloom frame settings confusion.
In [this forum post](https://forum.unity.com/threads/disabling-post-processing-effects-in-the-default-volume-profile.1545362/#post-9891525), a user complained that even if Bloom frame settings was set to false, if there was a screen space lens flare override, we "reactivated" the bloom pass without the user's knowledge which can be confusing and deceiving. Now, SSLF frame settings is now a child of the Bloom frame settings. In addition, there's a warning box directly in the override if any of the frame setting (bloom or SSLF) is set to false preventing the bloom pass to be executed without the users knowledge. ![image](https://media.github.cds.internal.unity3d.com/user/1764/files/6e522a47-79f2-49fe-aeaf-d9d4166467ef) In addition, since SSLF writes directly on the bloom buffer and uses the uberpass bloom to be rendered, if bloom intensity is set to zero, it won't render. So in the SSLF override there's now a message warning you that one or more bloom override prevents SSLF to be rendered. ![image](https://media.github.cds.internal.unity3d.com/user/1764/files/16320f54-ad23-4338-a5c7-9e4f0788db65) Lastly, I took the opportunity with this PR to add the frame settings check wherever it made sense in the current override to avoid further users confusions (cf [commit](https://github.cds.internal.unity3d.com/unity/unity/pull/51061/commits/32f1369d6710394879f23d2f24f84b73a68710cb)).
1 parent 0563fc9 commit 5dae334

27 files changed

+111
-16
lines changed

Packages/com.unity.render-pipelines.high-definition/Editor/Lighting/Reflection/HDScreenSpaceReflectionEditor.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,8 @@ void RayTracedReflectionGUI(RayCastingMode tracingMode)
188188
{
189189
HDRenderPipelineAsset currentAsset = HDRenderPipeline.currentAsset;
190190

191+
HDEditorUtils.EnsureFrameSetting(FrameSettingsField.RayTracing, "RayTracing");
192+
191193
if (RenderPipelineManager.currentPipeline is not HDRenderPipeline { rayTracingSupported: true })
192194
HDRenderPipelineUI.DisplayRayTracingSupportBox();
193195

Packages/com.unity.render-pipelines.high-definition/Editor/Lighting/Reflection/ScreenSpaceRefractionEditor.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ public override void OnEnable()
1717

1818
public override void OnInspectorGUI()
1919
{
20+
HDEditorUtils.EnsureFrameSetting(FrameSettingsField.Refraction, "Refraction");
2021
PropertyField(m_ScreenFadeDistance, k_ScreenFadeDistance);
2122
}
2223

Packages/com.unity.render-pipelines.high-definition/Editor/Lighting/ScreenSpaceAmbientOcclusionEditor.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@ private static class Styles
101101

102102
public override void OnInspectorGUI()
103103
{
104+
HDEditorUtils.EnsureFrameSetting(FrameSettingsField.SSAO, "Screen Space Ambient Occlusion");
104105
HDRenderPipelineAsset currentAsset = HDRenderPipeline.currentAsset;
105106
bool notSupported = currentAsset != null && !currentAsset.currentPlatformRenderPipelineSettings.supportSSAO;
106107
if (notSupported)
@@ -117,6 +118,7 @@ public override void OnInspectorGUI()
117118

118119
if (m_RayTracing.overrideState.boolValue && m_RayTracing.value.boolValue)
119120
{
121+
HDEditorUtils.EnsureFrameSetting(FrameSettingsField.RayTracing, "RayTracing");
120122
// If ray tracing is supported display the content of the volume component
121123
if (RenderPipelineManager.currentPipeline is not HDRenderPipeline { rayTracingSupported: true })
122124
HDRenderPipelineUI.DisplayRayTracingSupportBox();

Packages/com.unity.render-pipelines.high-definition/Editor/Lighting/Shadow/ContactShadowsEditor.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@ public override void OnEnable()
4040

4141
public override void OnInspectorGUI()
4242
{
43+
HDEditorUtils.EnsureFrameSetting(FrameSettingsField.ContactShadows, "Contact Shadows");
44+
4345
PropertyField(m_Enable, EditorGUIUtility.TrTextContent("State", "When enabled, HDRP processes Contact Shadows for this Volume."));
4446

4547
if (!m_Enable.value.hasMultipleDifferentValues)

Packages/com.unity.render-pipelines.high-definition/Editor/Lighting/Shadow/HDShadowSettingsEditor.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,8 @@ public override void OnEnable()
4545

4646
public override void OnInspectorGUI()
4747
{
48+
HDEditorUtils.EnsureFrameSetting(FrameSettingsField.ShadowMaps, "Shadow Maps");
49+
4850
PropertyField(m_MaxShadowDistance, EditorGUIUtility.TrTextContent("Max Distance", "In Meter"));
4951

5052
EditorGUILayout.Space();

Packages/com.unity.render-pipelines.high-definition/Editor/Lighting/VolumetricClouds/VolumetricCloudsEditor.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -507,6 +507,8 @@ bool CloudsShapeUI()
507507

508508
public override void OnInspectorGUI()
509509
{
510+
HDEditorUtils.EnsureFrameSetting(FrameSettingsField.VolumetricClouds, "Volumetric Clouds");
511+
510512
// This whole editor has nothing to display if the SSR feature is not supported
511513
HDRenderPipelineAsset currentAsset = HDRenderPipeline.currentAsset;
512514
bool notSupported = currentAsset != null && !currentAsset.currentPlatformRenderPipelineSettings.supportVolumetricClouds;

Packages/com.unity.render-pipelines.high-definition/Editor/PostProcessing/BloomEditor.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@ public override void OnEnable()
3939

4040
public override void OnInspectorGUI()
4141
{
42+
HDEditorUtils.EnsureFrameSetting(FrameSettingsField.Bloom, "Bloom");
43+
4244
base.OnInspectorGUI();
4345

4446
PropertyField(m_Threshold);

Packages/com.unity.render-pipelines.high-definition/Editor/PostProcessing/ChromaticAberrationEditor.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ public override void OnEnable()
2424

2525
public override void OnInspectorGUI()
2626
{
27+
HDEditorUtils.EnsureFrameSetting(FrameSettingsField.ChromaticAberration, "Chromatic Aberration");
2728
PropertyField(m_SpectralLUT);
2829
PropertyField(m_Intensity);
2930

Packages/com.unity.render-pipelines.high-definition/Editor/PostProcessing/DepthOfFieldEditor.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,8 @@ public override void OnEnable()
8383

8484
public override void OnInspectorGUI()
8585
{
86+
HDEditorUtils.EnsureFrameSetting(FrameSettingsField.DepthOfField, "Depth Of Field");
87+
8688
PropertyField(m_FocusMode, Styles.k_DepthOfFieldMode);
8789

8890
int mode = m_FocusMode.value.intValue;

Packages/com.unity.render-pipelines.high-definition/Editor/PostProcessing/FilmGrainEditor.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ public override void OnEnable()
2424

2525
public override void OnInspectorGUI()
2626
{
27+
HDEditorUtils.EnsureFrameSetting(FrameSettingsField.FilmGrain, "Film Grain");
28+
2729
PropertyField(m_Type);
2830

2931
if (m_Type.value.intValue == (int)FilmGrainLookup.Custom)

0 commit comments

Comments
 (0)