Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
1ba5abb
Improve DoF UX
pmavridis Jun 9, 2020
b61c5a1
Changelog
pmavridis Jun 9, 2020
8f49a9e
Comments
pmavridis Jun 10, 2020
928d890
Avoid storing nulls in the history table
pmavridis Jun 10, 2020
933448c
Properly read selected quality preset + other bugfix
pmavridis Jun 10, 2020
9d1e0f0
typo
pmavridis Jun 10, 2020
0f896e4
changed comment position
pmavridis Jun 10, 2020
bfe7bd5
don't switch to custom quality if the values were not changed
pmavridis Jun 11, 2020
ea1b874
avoid compiler warning
pmavridis Jun 11, 2020
7920df5
more UX improvements
pmavridis Jun 12, 2020
25dc52f
make the override state of quality settings part of the memory we kee…
pmavridis Jun 12, 2020
114fbcc
fix minor UI issue when DoFis disabled
pmavridis Jun 12, 2020
3dc46c7
Branch-off from Pavlos' DOF UX, merge latest HDRP/staging
johnpars Jul 8, 2020
a58074d
Serialization for quality parameters was fixed, so we can ask for the…
johnpars Jul 8, 2020
a1cfe51
Introduce the HDEditorUtils.IndentScope
johnpars Jul 9, 2020
8e2da0f
Generalize the quality setting blob before introducing changes to the…
johnpars Jul 9, 2020
0f8e91b
Introduce scalability change for chromatic abberation
johnpars Jul 9, 2020
a51d8ac
Introduce scalability change for contact shadow
johnpars Jul 9, 2020
f1148f1
Introduce quality setting change for bloom
johnpars Jul 9, 2020
620e54b
Further generalize the quality setting blob to cut down on repetitive…
johnpars Jul 12, 2020
99f6e34
Update contact shadow, bloom, CA, and DOF editors to reflect the qual…
johnpars Jul 12, 2020
ce1202a
Fix the quality setting comparison.
johnpars Jul 13, 2020
90f6b3d
Introduce quality setting change for ambient occlusion
johnpars Jul 13, 2020
b91e5c2
Introduce quality setting change for motion blur
johnpars Jul 13, 2020
11e03f4
Introduce quality setting change for RTGI and SSGI
johnpars Jul 14, 2020
e332fa0
Generalize the quality preset loading
johnpars Jul 14, 2020
a3e91a4
Introduce quality setting change for SSR and RTR
johnpars Jul 14, 2020
3ef2f92
Merge latest staging
johnpars Jul 14, 2020
6e66409
Merge physical based dof editor change
johnpars Jul 14, 2020
92c5050
Add comments
johnpars Jul 15, 2020
40190b3
Add comments
johnpars Jul 15, 2020
35707d3
Update changelog
johnpars Jul 15, 2020
505833e
Remove unused namespace
johnpars Jul 15, 2020
371fc26
Remove usage of indent scope/UI modification (except for in DoF) unti…
johnpars Jul 16, 2020
2f8b134
DoF tooltips were accidentally reverted in the merge, re-add the fix
johnpars Jul 16, 2020
332923f
Simply the QualityScope disposal
johnpars Jul 16, 2020
cdbbe4f
Merge latest HDRP/staging
johnpars Jul 16, 2020
946020d
Merge Master + Fix Raytracing Git Hook Case Sensitivity Violation)
johnpars Oct 20, 2020
2b26956
Organize quality volume components to place the quality settings at t…
johnpars Oct 21, 2020
39a575a
Fixed and issue with quality setting now displayed the preset value o…
johnpars Oct 22, 2020
ee77e7c
Revert "Organize quality volume components to place the quality setti…
johnpars Oct 23, 2020
127526b
Implement UX request to indent the checkbox for quality volumes
johnpars Oct 23, 2020
ffa1b4f
Decouple quality setting loading between RTR and SSR (some setting ar…
johnpars Oct 23, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,6 @@ class AmbientOcclusionEditor : VolumeComponentWithQualityEditor

public override void OnEnable()
{
base.OnEnable();

var o = new PropertyFetcher<AmbientOcclusion>(serializedObject);

m_Intensity = Unpack(o.Find(x => x.intensity));
Expand All @@ -61,6 +59,8 @@ public override void OnEnable()
m_Denoise = Unpack(o.Find(x => x.denoise));
m_SampleCount = Unpack(o.Find(x => x.sampleCount));
m_DenoiserRadius = Unpack(o.Find(x => x.denoiserRadius));

base.OnEnable();
}

public override void OnInspectorGUI()
Expand All @@ -84,61 +84,111 @@ public override void OnInspectorGUI()
{
PropertyField(m_LayerMask, EditorGUIUtility.TrTextContent("Layer Mask", "Layer mask used to include the objects for ambient occlusion."));
base.OnInspectorGUI(); // Quality Setting
using (new EditorGUI.DisabledScope(!useCustomValue))
using (new QualityScope(this))
{
EditorGUI.indentLevel++;
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."));
PropertyField(m_SampleCount, EditorGUIUtility.TrTextContent("Sample Count", "Number of samples for ray traced ambient occlusion."));
PropertyField(m_Denoise, EditorGUIUtility.TrTextContent("Denoise", "Enable denoising on the ray traced ambient occlusion."));
using (new HDEditorUtils.IndentScope())
{
EditorGUI.indentLevel++;
PropertyField(m_DenoiserRadius, EditorGUIUtility.TrTextContent("Denoiser Radius", "Radius parameter for the denoising."));
EditorGUI.indentLevel--;
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."));
PropertyField(m_SampleCount, EditorGUIUtility.TrTextContent("Sample Count", "Number of samples for ray traced ambient occlusion."));
PropertyField(m_Denoise, EditorGUIUtility.TrTextContent("Denoise", "Enable denoising on the ray traced ambient occlusion."));
{
using (new HDEditorUtils.IndentScope())
PropertyField(m_DenoiserRadius, EditorGUIUtility.TrTextContent("Denoiser Radius", "Radius parameter for the denoising."));
}
}
EditorGUI.indentLevel--;
}
}
else
{

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."));

base.OnInspectorGUI(); // Quality Setting
using (new EditorGUI.DisabledScope(!useCustomValue))

using (new QualityScope(this))
{
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."));
PropertyField(m_FullResolution, EditorGUIUtility.TrTextContent("Full Resolution", "The effect runs at full resolution. This increases quality, but also decreases performance significantly."));
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)."));
}

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."));
EditorGUI.indentLevel++;
if(!m_TemporalAccumulation.value.boolValue)
{
using (new EditorGUI.DisabledScope(!useCustomValue))
{
PropertyField(m_DirectionCount, EditorGUIUtility.TrTextContent("Direction Count", "Number of directions searched for occlusion at each each pixel."));
}
if (m_DirectionCount.value.intValue > 3)
{
EditorGUILayout.HelpBox("Performance will be seriously impacted by high direction count.", MessageType.Warning, wide: true);
}
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."));
}
else
{
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."));
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."));
if (isInAdvancedMode && !m_FullResolution.value.boolValue)
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."));

using (new HDEditorUtils.IndentScope())
{
using (new EditorGUI.DisabledScope(!useCustomValue))
if(!m_TemporalAccumulation.value.boolValue)
{
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."));
PropertyField(m_DirectionCount, EditorGUIUtility.TrTextContent("Direction Count", "Number of directions searched for occlusion at each each pixel."));

if (m_DirectionCount.value.intValue > 3)
{
EditorGUILayout.HelpBox("Performance will be seriously impacted by high direction count.", MessageType.Warning, wide: true);
}
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."));
}
else
{
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."));
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."));
if (isInAdvancedMode && !m_FullResolution.value.boolValue)
{
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."));
}
}
}
}
EditorGUI.indentLevel--;
}
}

public override QualitySettingsBlob SaveCustomQualitySettingsAsObject(QualitySettingsBlob settings = null)
{
if (settings == null)
settings = new QualitySettingsBlob();

// RTAO
settings.Save<float>(m_RayLength);
settings.Save<int>(m_SampleCount);
settings.Save<bool>(m_Denoise);
settings.Save<float>(m_DenoiserRadius);

// SSAO
settings.Save<int>(m_MaximumRadiusInPixels);
settings.Save<bool>(m_FullResolution);
settings.Save<int>(m_StepCount);
settings.Save<int>(m_DirectionCount);
settings.Save<bool>(m_BilateralUpsample);

return settings;
}

public override void LoadSettingsFromObject(QualitySettingsBlob settings)
{
// RTAO
settings.TryLoad<float>(ref m_RayLength);
settings.TryLoad<int>(ref m_SampleCount);
settings.TryLoad<bool>(ref m_Denoise);
settings.TryLoad<float>(ref m_DenoiserRadius);

// SSAO
settings.TryLoad<int>(ref m_MaximumRadiusInPixels);
settings.TryLoad<bool>(ref m_FullResolution);
settings.TryLoad<int>(ref m_StepCount);
settings.TryLoad<int>(ref m_DirectionCount);
settings.TryLoad<bool>(ref m_BilateralUpsample);
}

public override void LoadSettingsFromQualityPreset(RenderPipelineSettings settings, int level)
{
// RTAO
CopySetting(ref m_RayLength, settings.lightingQualitySettings.RTAORayLength[level]);
CopySetting(ref m_SampleCount, settings.lightingQualitySettings.RTAOSampleCount[level]);
CopySetting(ref m_Denoise, settings.lightingQualitySettings.RTAODenoise[level]);
CopySetting(ref m_DenoiserRadius, settings.lightingQualitySettings.RTAODenoiserRadius[level]);

// SSAO
CopySetting(ref m_MaximumRadiusInPixels, settings.lightingQualitySettings.AOMaximumRadiusPixels[level]);
CopySetting(ref m_FullResolution, settings.lightingQualitySettings.AOFullRes[level]);
CopySetting(ref m_StepCount, settings.lightingQualitySettings.AOStepCount[level]);
CopySetting(ref m_DirectionCount, settings.lightingQualitySettings.AODirectionCount[level]);
CopySetting(ref m_BilateralUpsample, settings.lightingQualitySettings.AOBilateralUpsample[level]);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,6 @@ class HDScreenSpaceReflectionEditor : VolumeComponentWithQualityEditor

public override void OnEnable()
{
base.OnEnable();

var o = new PropertyFetcher<ScreenSpaceReflection>(serializedObject);
m_Enable = Unpack(o.Find(x => x.enabled));
m_RayTracing = Unpack(o.Find(x => x.rayTracing));
Expand Down Expand Up @@ -70,6 +68,8 @@ public override void OnEnable()
// Quality
m_SampleCount = Unpack(o.Find(x => x.sampleCount));
m_BounceCount = Unpack(o.Find(x => x.bounceCount));

base.OnEnable();
}

static public readonly GUIContent k_RayTracingText = EditorGUIUtility.TrTextContent("Ray Tracing (Preview)", "Enable ray traced reflections.");
Expand Down Expand Up @@ -100,20 +100,20 @@ void RayTracingQualityModeGUI()
PropertyField(m_SampleCount, k_SampleCountText);
PropertyField(m_BounceCount, k_BounceCountText);
PropertyField(m_Denoise, k_DenoiseText);
using (new HDEditorUtils.IndentScope())
{
EditorGUI.indentLevel++;
PropertyField(m_DenoiserRadius, k_DenoiseRadiusText);
EditorGUI.indentLevel--;
}
}


void RayTracingPerformanceModeGUI()
{
base.OnInspectorGUI();
using (new EditorGUI.DisabledScope(!useCustomValue))

using (new HDEditorUtils.IndentScope())
using (new QualityScope(this))
{
EditorGUI.indentLevel++;
PropertyField(m_MinSmoothness, k_MinimumSmoothnessText);
PropertyField(m_SmoothnessFadeStart, k_SmoothnessFadeStartText);
m_SmoothnessFadeStart.value.floatValue = Mathf.Max(m_MinSmoothness.value.floatValue, m_SmoothnessFadeStart.value.floatValue);
Expand All @@ -122,12 +122,10 @@ void RayTracingPerformanceModeGUI()
PropertyField(m_UpscaleRadius, k_UpscaleRadiusText);
PropertyField(m_FullResolution, k_FullResolutionText);
PropertyField(m_Denoise, k_DenoiseText);
using (new HDEditorUtils.IndentScope())
{
EditorGUI.indentLevel++;
PropertyField(m_DenoiserRadius, k_DenoiseRadiusText);
EditorGUI.indentLevel--;
}
EditorGUI.indentLevel--;
}
}

Expand All @@ -140,21 +138,23 @@ void RayTracedReflectionGUI()
if (currentAsset.currentPlatformRenderPipelineSettings.supportedRayTracingMode == RenderPipelineSettings.SupportedRayTracingMode.Both)
{
PropertyField(m_Mode, k_ModeText);
EditorGUI.indentLevel++;
switch (m_Mode.value.GetEnumValue<RayTracingMode>())

using (new HDEditorUtils.IndentScope())
{
case RayTracingMode.Performance:
{
RayTracingPerformanceModeGUI();
}
break;
case RayTracingMode.Quality:
switch (m_Mode.value.GetEnumValue<RayTracingMode>())
{
RayTracingQualityModeGUI();
case RayTracingMode.Performance:
{
RayTracingPerformanceModeGUI();
}
break;
case RayTracingMode.Quality:
{
RayTracingQualityModeGUI();
}
break;
}
break;
}
EditorGUI.indentLevel--;
}
else if (currentAsset.currentPlatformRenderPipelineSettings.supportedRayTracingMode == RenderPipelineSettings.SupportedRayTracingMode.Quality)
{
Expand Down Expand Up @@ -202,14 +202,78 @@ public override void OnInspectorGUI()
m_DepthBufferThickness.value.floatValue = Mathf.Clamp(m_DepthBufferThickness.value.floatValue, 0.001f, 1.0f);

base.OnInspectorGUI();
using (new EditorGUI.DisabledScope(!useCustomValue))

using (new HDEditorUtils.IndentScope())
using (new QualityScope(this))
{
EditorGUI.indentLevel++;
PropertyField(m_RayMaxIterations, k_RayMaxIterationsText);
m_RayMaxIterations.value.intValue = Mathf.Max(0, m_RayMaxIterations.value.intValue);
EditorGUI.indentLevel--;
}
}
}
public override QualitySettingsBlob SaveCustomQualitySettingsAsObject(QualitySettingsBlob settings = null)
{
if (settings == null)
settings = new QualitySettingsBlob();

// RTR
if (HDRenderPipeline.pipelineSupportsRayTracing && m_RayTracing.overrideState.boolValue &&
m_RayTracing.value.boolValue)
{
settings.Save<float>(m_MinSmoothness);
settings.Save<float>(m_SmoothnessFadeStart);
settings.Save<float>(m_RayLength);
settings.Save<float>(m_ClampValue);
settings.Save<int>(m_UpscaleRadius);
settings.Save<bool>(m_FullResolution);
settings.Save<bool>(m_Denoise);
settings.Save<int>(m_DenoiserRadius);
}
// SSR
else
settings.Save<int>(m_RayMaxIterations);

return settings;
}

public override void LoadSettingsFromObject(QualitySettingsBlob settings)
{
// RTR
if (HDRenderPipeline.pipelineSupportsRayTracing && m_RayTracing.overrideState.boolValue &&
m_RayTracing.value.boolValue)
{
settings.TryLoad<float>(ref m_MinSmoothness);
settings.TryLoad<float>(ref m_SmoothnessFadeStart);
settings.TryLoad<float>(ref m_RayLength);
settings.TryLoad<float>(ref m_ClampValue);
settings.TryLoad<int>(ref m_UpscaleRadius);
settings.TryLoad<bool>(ref m_FullResolution);
settings.TryLoad<bool>(ref m_Denoise);
settings.TryLoad<int>(ref m_DenoiserRadius);
}
// SSR
else
settings.TryLoad<int>(ref m_RayMaxIterations);
}

public override void LoadSettingsFromQualityPreset(RenderPipelineSettings settings, int level)
{
// RTR
if (HDRenderPipeline.pipelineSupportsRayTracing && m_RayTracing.overrideState.boolValue &&
m_RayTracing.value.boolValue)
{
CopySetting(ref m_MinSmoothness, settings.lightingQualitySettings.RTRMinSmoothness[level]);
CopySetting(ref m_SmoothnessFadeStart, settings.lightingQualitySettings.RTRSmoothnessFadeStart[level]);
CopySetting(ref m_RayLength, settings.lightingQualitySettings.RTRRayLength[level]);
CopySetting(ref m_ClampValue, settings.lightingQualitySettings.RTRClampValue[level]);
CopySetting(ref m_UpscaleRadius, settings.lightingQualitySettings.RTRUpScaleRadius[level]);
CopySetting(ref m_FullResolution, settings.lightingQualitySettings.RTRFullResolution[level]);
CopySetting(ref m_Denoise, settings.lightingQualitySettings.RTRDenoise[level]);
CopySetting(ref m_DenoiserRadius, settings.lightingQualitySettings.RTRDenoiserRadius[level]);
}
// SSR
else
CopySetting(ref m_RayMaxIterations, settings.lightingQualitySettings.SSRMaxRaySteps[level]);
}
}
}
Loading