Skip to content

Commit 2b26956

Browse files
committed
Organize quality volume components to place the quality settings at the bottom (match how DoF is done).
1 parent 946020d commit 2b26956

File tree

9 files changed

+237
-188
lines changed

9 files changed

+237
-188
lines changed

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

Lines changed: 48 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -83,56 +83,67 @@ public override void OnInspectorGUI()
8383
if (HDRenderPipeline.pipelineSupportsRayTracing && m_RayTracing.overrideState.boolValue && m_RayTracing.value.boolValue)
8484
{
8585
PropertyField(m_LayerMask, EditorGUIUtility.TrTextContent("Layer Mask", "Layer mask used to include the objects for ambient occlusion."));
86+
8687
base.OnInspectorGUI(); // Quality Setting
87-
using (new QualityScope(this))
88-
{
89-
EditorGUI.indentLevel++;
90-
PropertyField(m_RayLength, EditorGUIUtility.TrTextContent("Max Ray Length", "Controls the maximal length of ambient occlusion rays. The higher this value is, the more expensive ray traced ambient occlusion is."));
91-
PropertyField(m_SampleCount, EditorGUIUtility.TrTextContent("Sample Count", "Number of samples for ray traced ambient occlusion."));
92-
PropertyField(m_Denoise, EditorGUIUtility.TrTextContent("Denoise", "Enable denoising on the ray traced ambient occlusion."));
93-
{
94-
EditorGUI.indentLevel++;
95-
PropertyField(m_DenoiserRadius, EditorGUIUtility.TrTextContent("Denoiser Radius", "Radius parameter for the denoising."));
96-
EditorGUI.indentLevel--;
97-
}
98-
EditorGUI.indentLevel--;
99-
}
10088
}
10189
else
10290
{
103-
10491
PropertyField(m_Radius, EditorGUIUtility.TrTextContent("Radius", "Sampling radius. Bigger the radius, wider AO will be achieved, risking to lose fine details and increasing cost of the effect due to increasing cache misses."));
10592

106-
base.OnInspectorGUI(); // Quality Setting
93+
PropertyField(m_TemporalAccumulation, EditorGUIUtility.TrTextContent("Temporal Accumulation", "Whether the results are accumulated over time or not. This can get better results cheaper, but it can lead to temporal artifacts. Requires Motion Vectors to be enabled."));
10794

108-
using (new QualityScope(this))
95+
EditorGUI.indentLevel++;
96+
if(!m_TemporalAccumulation.value.boolValue)
10997
{
110-
PropertyField(m_MaximumRadiusInPixels, EditorGUIUtility.TrTextContent("Maximum Radius In Pixels", "This poses a maximum radius in pixels that we consider. It is very important to keep this as tight as possible to preserve good performance. Note that this is the value used for 1080p when *not* running the effect at full resolution, it will be scaled accordingly for other resolutions."));
111-
PropertyField(m_FullResolution, EditorGUIUtility.TrTextContent("Full Resolution", "The effect runs at full resolution. This increases quality, but also decreases performance significantly."));
112-
PropertyField(m_StepCount, EditorGUIUtility.TrTextContent("Step Count", "Number of steps to take along one signed direction during horizon search (this is the number of steps in positive and negative direction)."));
98+
if (m_DirectionCount.value.intValue > 3)
99+
{
100+
EditorGUILayout.HelpBox("Performance will be seriously impacted by high direction count.", MessageType.Warning, wide: true);
101+
}
102+
103+
PropertyField(m_BlurSharpness, EditorGUIUtility.TrTextContent("Blur sharpness", "Modify the non-temporal blur to change how sharp features are preserved. Lower values blurrier/softer, higher values sharper but with risk of noise."));
104+
}
105+
else
106+
{
107+
PropertyField(m_SpatialBilateralAggressiveness, EditorGUIUtility.TrTextContent("Bilateral Aggressiveness", "Higher this value, the less lenient with depth differences the spatial filter is. Increase if for example noticing white halos where AO should be."));
108+
PropertyField(m_GhostingAdjustement, EditorGUIUtility.TrTextContent("Ghosting reduction", "Moving this factor closer to 0 will increase the amount of accepted samples during temporal accumulation, increasing the ghosting, but reducing the temporal noise."));
109+
}
110+
EditorGUI.indentLevel--;
111+
112+
base.OnInspectorGUI(); // Quality Setting
113+
}
114+
}
115+
116+
public override void OnQualityGUI()
117+
{
118+
if (HDRenderPipeline.pipelineSupportsRayTracing && m_RayTracing.overrideState.boolValue &&
119+
m_RayTracing.value.boolValue)
120+
{
121+
PropertyField(m_RayLength, EditorGUIUtility.TrTextContent("Max Ray Length", "Controls the maximal length of ambient occlusion rays. The higher this value is, the more expensive ray traced ambient occlusion is."));
122+
PropertyField(m_SampleCount, EditorGUIUtility.TrTextContent("Sample Count", "Number of samples for ray traced ambient occlusion."));
113123

114-
PropertyField(m_TemporalAccumulation, EditorGUIUtility.TrTextContent("Temporal Accumulation", "Whether the results are accumulated over time or not. This can get better results cheaper, but it can lead to temporal artifacts. Requires Motion Vectors to be enabled."));
124+
PropertyField(m_Denoise, EditorGUIUtility.TrTextContent("Denoise", "Enable denoising on the ray traced ambient occlusion."));
125+
{
115126
EditorGUI.indentLevel++;
116-
if(!m_TemporalAccumulation.value.boolValue)
117-
{
118-
PropertyField(m_DirectionCount, EditorGUIUtility.TrTextContent("Direction Count", "Number of directions searched for occlusion at each each pixel."));
127+
PropertyField(m_DenoiserRadius, EditorGUIUtility.TrTextContent("Denoiser Radius", "Radius parameter for the denoising."));
128+
EditorGUI.indentLevel--;
129+
}
130+
}
131+
else
132+
{
133+
PropertyField(m_MaximumRadiusInPixels, EditorGUIUtility.TrTextContent("Maximum Radius In Pixels", "This poses a maximum radius in pixels that we consider. It is very important to keep this as tight as possible to preserve good performance. Note that this is the value used for 1080p when *not* running the effect at full resolution, it will be scaled accordingly for other resolutions."));
134+
PropertyField(m_FullResolution, EditorGUIUtility.TrTextContent("Full Resolution", "The effect runs at full resolution. This increases quality, but also decreases performance significantly."));
135+
PropertyField(m_StepCount, EditorGUIUtility.TrTextContent("Step Count", "Number of steps to take along one signed direction during horizon search (this is the number of steps in positive and negative direction)."));
119136

120-
if (m_DirectionCount.value.intValue > 3)
121-
{
122-
EditorGUILayout.HelpBox("Performance will be seriously impacted by high direction count.", MessageType.Warning, wide: true);
123-
}
124-
PropertyField(m_BlurSharpness, EditorGUIUtility.TrTextContent("Blur sharpness", "Modify the non-temporal blur to change how sharp features are preserved. Lower values blurrier/softer, higher values sharper but with risk of noise."));
125-
}
126-
else
137+
if(!m_TemporalAccumulation.value.boolValue)
138+
{
139+
PropertyField(m_DirectionCount, EditorGUIUtility.TrTextContent("Direction Count", "Number of directions searched for occlusion at each each pixel."));
140+
}
141+
else
142+
{
143+
if (isInAdvancedMode && !m_FullResolution.value.boolValue)
127144
{
128-
PropertyField(m_SpatialBilateralAggressiveness, EditorGUIUtility.TrTextContent("Bilateral Aggressiveness", "Higher this value, the less lenient with depth differences the spatial filter is. Increase if for example noticing white halos where AO should be."));
129-
PropertyField(m_GhostingAdjustement, EditorGUIUtility.TrTextContent("Ghosting reduction", "Moving this factor closer to 0 will increase the amount of accepted samples during temporal accumulation, increasing the ghosting, but reducing the temporal noise."));
130-
if (isInAdvancedMode && !m_FullResolution.value.boolValue)
131-
{
132-
PropertyField(m_BilateralUpsample, EditorGUIUtility.TrTextContent("Bilateral Upsample", "This upsample method preserves sharp edges better, however can result in visible aliasing and it is slightly more expensive."));
133-
}
145+
PropertyField(m_BilateralUpsample, EditorGUIUtility.TrTextContent("Bilateral Upsample", "This upsample method preserves sharp edges better, however can result in visible aliasing and it is slightly more expensive."));
134146
}
135-
EditorGUI.indentLevel--;
136147
}
137148
}
138149
}

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

Lines changed: 74 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -107,28 +107,14 @@ void RayTracingQualityModeGUI()
107107
}
108108
}
109109

110-
111110
void RayTracingPerformanceModeGUI()
112111
{
113-
base.OnInspectorGUI();
114-
115-
using (new QualityScope(this))
112+
// Revert all of the indentation at this point since it will be formatted differently in the quality GUI.
113+
using (new EditorGUI.IndentLevelScope(-EditorGUI.indentLevel))
116114
{
117-
EditorGUI.indentLevel++;
118-
PropertyField(m_MinSmoothness, k_MinimumSmoothnessText);
119-
PropertyField(m_SmoothnessFadeStart, k_SmoothnessFadeStartText);
120-
m_SmoothnessFadeStart.value.floatValue = Mathf.Max(m_MinSmoothness.value.floatValue, m_SmoothnessFadeStart.value.floatValue);
121-
PropertyField(m_RayLength, k_RayLengthText);
122-
PropertyField(m_ClampValue, k_ClampValueText);
123-
PropertyField(m_UpscaleRadius, k_UpscaleRadiusText);
124-
PropertyField(m_FullResolution, k_FullResolutionText);
125-
PropertyField(m_Denoise, k_DenoiseText);
126-
{
127-
EditorGUI.indentLevel++;
128-
PropertyField(m_DenoiserRadius, k_DenoiseRadiusText);
129-
EditorGUI.indentLevel--;
130-
}
131-
EditorGUI.indentLevel--;
115+
// Performance GUI is entirely composed of quality settings. Defer drawing this to the base and handle
116+
// drawing it in OnQualityGUI.
117+
base.OnInspectorGUI();
132118
}
133119
}
134120

@@ -203,67 +189,103 @@ public override void OnInspectorGUI()
203189
m_DepthBufferThickness.value.floatValue = Mathf.Clamp(m_DepthBufferThickness.value.floatValue, 0.001f, 1.0f);
204190

205191
base.OnInspectorGUI();
192+
}
193+
}
206194

207-
using (new QualityScope(this))
195+
public override void OnQualityGUI()
196+
{
197+
// RTR
198+
if (HDRenderPipeline.pipelineSupportsRayTracing && m_RayTracing.overrideState.boolValue &&
199+
m_RayTracing.value.boolValue)
200+
{
201+
PropertyField(m_MinSmoothness, k_MinimumSmoothnessText);
202+
PropertyField(m_SmoothnessFadeStart, k_SmoothnessFadeStartText);
203+
m_SmoothnessFadeStart.value.floatValue = Mathf.Max(m_MinSmoothness.value.floatValue, m_SmoothnessFadeStart.value.floatValue);
204+
PropertyField(m_RayLength, k_RayLengthText);
205+
PropertyField(m_ClampValue, k_ClampValueText);
206+
PropertyField(m_UpscaleRadius, k_UpscaleRadiusText);
207+
PropertyField(m_FullResolution, k_FullResolutionText);
208+
PropertyField(m_Denoise, k_DenoiseText);
208209
{
209210
EditorGUI.indentLevel++;
210-
PropertyField(m_RayMaxIterations, k_RayMaxIterationsText);
211-
m_RayMaxIterations.value.intValue = Mathf.Max(0, m_RayMaxIterations.value.intValue);
211+
PropertyField(m_DenoiserRadius, k_DenoiseRadiusText);
212212
EditorGUI.indentLevel--;
213213
}
214214
}
215+
// SSR
216+
else
217+
{
218+
PropertyField(m_RayMaxIterations, k_RayMaxIterationsText);
219+
m_RayMaxIterations.value.intValue = Mathf.Max(0, m_RayMaxIterations.value.intValue);
220+
}
215221
}
222+
216223
public override QualitySettingsBlob SaveCustomQualitySettingsAsObject(QualitySettingsBlob settings = null)
217224
{
218225
if (settings == null)
219226
settings = new QualitySettingsBlob();
220227

221228
// RTR
222-
settings.Save<float>(m_MinSmoothness);
223-
settings.Save<float>(m_SmoothnessFadeStart);
224-
settings.Save<float>(m_RayLength);
225-
settings.Save<float>(m_ClampValue);
226-
settings.Save<int>(m_UpscaleRadius);
227-
settings.Save<bool>(m_FullResolution);
228-
settings.Save<bool>(m_Denoise);
229-
settings.Save<int>(m_DenoiserRadius);
230-
229+
if (HDRenderPipeline.pipelineSupportsRayTracing && m_RayTracing.overrideState.boolValue &&
230+
m_RayTracing.value.boolValue)
231+
{
232+
settings.Save<float>(m_MinSmoothness);
233+
settings.Save<float>(m_SmoothnessFadeStart);
234+
settings.Save<float>(m_RayLength);
235+
settings.Save<float>(m_ClampValue);
236+
settings.Save<int>(m_UpscaleRadius);
237+
settings.Save<bool>(m_FullResolution);
238+
settings.Save<bool>(m_Denoise);
239+
settings.Save<int>(m_DenoiserRadius);
240+
}
231241
// SSR
232-
settings.Save<int>(m_RayMaxIterations);
242+
else
243+
settings.Save<int>(m_RayMaxIterations);
233244

234245
return settings;
235246
}
236247

237248
public override void LoadSettingsFromObject(QualitySettingsBlob settings)
238249
{
239250
// RTR
240-
settings.TryLoad<float>(ref m_MinSmoothness);
241-
settings.TryLoad<float>(ref m_SmoothnessFadeStart);
242-
settings.TryLoad<float>(ref m_RayLength);
243-
settings.TryLoad<float>(ref m_ClampValue);
244-
settings.TryLoad<int>(ref m_UpscaleRadius);
245-
settings.TryLoad<bool>(ref m_FullResolution);
246-
settings.TryLoad<bool>(ref m_Denoise);
247-
settings.TryLoad<int>(ref m_DenoiserRadius);
248-
251+
if (HDRenderPipeline.pipelineSupportsRayTracing && m_RayTracing.overrideState.boolValue &&
252+
m_RayTracing.value.boolValue)
253+
{
254+
settings.TryLoad<float>(ref m_MinSmoothness);
255+
settings.TryLoad<float>(ref m_SmoothnessFadeStart);
256+
settings.TryLoad<float>(ref m_RayLength);
257+
settings.TryLoad<float>(ref m_ClampValue);
258+
settings.TryLoad<int>(ref m_UpscaleRadius);
259+
settings.TryLoad<bool>(ref m_FullResolution);
260+
settings.TryLoad<bool>(ref m_Denoise);
261+
settings.TryLoad<int>(ref m_DenoiserRadius);
262+
}
249263
// SSR
250-
settings.TryLoad<int>(ref m_RayMaxIterations);
264+
else
265+
settings.TryLoad<int>(ref m_RayMaxIterations);
251266
}
252267

253268
public override void LoadSettingsFromQualityPreset(RenderPipelineSettings settings, int level)
254269
{
255270
// RTR
256-
CopySetting(ref m_MinSmoothness, settings.lightingQualitySettings.RTRMinSmoothness[level]);
257-
CopySetting(ref m_SmoothnessFadeStart, settings.lightingQualitySettings.RTRSmoothnessFadeStart[level]);
258-
CopySetting(ref m_RayLength, settings.lightingQualitySettings.RTRRayLength[level]);
259-
CopySetting(ref m_ClampValue, settings.lightingQualitySettings.RTRClampValue[level]);
260-
CopySetting(ref m_UpscaleRadius, settings.lightingQualitySettings.RTRUpScaleRadius[level]);
261-
CopySetting(ref m_FullResolution, settings.lightingQualitySettings.RTRFullResolution[level]);
262-
CopySetting(ref m_Denoise, settings.lightingQualitySettings.RTRDenoise[level]);
263-
CopySetting(ref m_DenoiserRadius, settings.lightingQualitySettings.RTRDenoiserRadius[level]);
264-
271+
// Note: We need to handle the raytracing case like this (instead of not caring), because some SSR settings
272+
// (ie Min Smoothness), are note quality settings, but they are for RTR. Because of that, by switching between
273+
// custom blob / presets, normal settings in SSR mode will be modified, which we don't want.
274+
if (HDRenderPipeline.pipelineSupportsRayTracing && m_RayTracing.overrideState.boolValue &&
275+
m_RayTracing.value.boolValue)
276+
{
277+
CopySetting(ref m_MinSmoothness, settings.lightingQualitySettings.RTRMinSmoothness[level]);
278+
CopySetting(ref m_SmoothnessFadeStart, settings.lightingQualitySettings.RTRSmoothnessFadeStart[level]);
279+
CopySetting(ref m_RayLength, settings.lightingQualitySettings.RTRRayLength[level]);
280+
CopySetting(ref m_ClampValue, settings.lightingQualitySettings.RTRClampValue[level]);
281+
CopySetting(ref m_UpscaleRadius, settings.lightingQualitySettings.RTRUpScaleRadius[level]);
282+
CopySetting(ref m_FullResolution, settings.lightingQualitySettings.RTRFullResolution[level]);
283+
CopySetting(ref m_Denoise, settings.lightingQualitySettings.RTRDenoise[level]);
284+
CopySetting(ref m_DenoiserRadius, settings.lightingQualitySettings.RTRDenoiserRadius[level]);
285+
}
265286
// SSR
266-
CopySetting(ref m_RayMaxIterations, settings.lightingQualitySettings.SSRMaxRaySteps[level]);
287+
else
288+
CopySetting(ref m_RayMaxIterations, settings.lightingQualitySettings.SSRMaxRaySteps[level]);
267289
}
268290
}
269291
}

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

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -57,13 +57,14 @@ public override void OnInspectorGUI()
5757
PropertyField(m_Thickness, EditorGUIUtility.TrTextContent("Thickness", "Controls the thickness of the objects found along the ray, essentially thickening the contact shadows."));
5858

5959
base.OnInspectorGUI();
60-
61-
using (new QualityScope(this))
62-
{
63-
PropertyField(m_SampleCount, EditorGUIUtility.TrTextContent("Sample Count", "Controls the number of samples HDRP uses for ray casting."));
64-
}
6560
}
6661
}
62+
63+
public override void OnQualityGUI()
64+
{
65+
PropertyField(m_SampleCount, EditorGUIUtility.TrTextContent("Sample Count", "Controls the number of samples HDRP uses for ray casting."));
66+
}
67+
6768
public override QualitySettingsBlob SaveCustomQualitySettingsAsObject(QualitySettingsBlob settings = null)
6869
{
6970
if (settings == null)

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

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,6 @@ public override void OnEnable()
4343

4444
public override void OnInspectorGUI()
4545
{
46-
base.OnInspectorGUI();
47-
4846
EditorGUILayout.LabelField("Bloom", EditorStyles.miniLabel);
4947
PropertyField(m_Threshold);
5048
PropertyField(m_Intensity);
@@ -59,16 +57,22 @@ public override void OnInspectorGUI()
5957
{
6058
EditorGUILayout.LabelField("Advanced Tweaks", EditorStyles.miniLabel);
6159

62-
using (new QualityScope(this))
63-
{
64-
PropertyField(m_Resolution);
65-
PropertyField(m_HighQualityPrefiltering);
66-
PropertyField(m_HighQualityFiltering);
67-
}
68-
6960
PropertyField(m_Anamorphic);
7061
}
62+
63+
base.OnInspectorGUI();
64+
}
65+
66+
public override void OnQualityGUI()
67+
{
68+
if (isInAdvancedMode)
69+
{
70+
PropertyField(m_Resolution);
71+
PropertyField(m_HighQualityPrefiltering);
72+
PropertyField(m_HighQualityFiltering);
73+
}
7174
}
75+
7276
public override QualitySettingsBlob SaveCustomQualitySettingsAsObject(QualitySettingsBlob settings = null)
7377
{
7478
if (settings == null)

0 commit comments

Comments
 (0)