From f6cf89fdc1ff62d6be838799766d7e345a4065ee Mon Sep 17 00:00:00 2001 From: Julien Ignace Date: Tue, 12 May 2020 17:35:35 +0200 Subject: [PATCH 1/2] Removed logic in the UI to disable parameters for contact shadows and fog volume components as it was going against the concept of the volume system. # Conflicts: # com.unity.render-pipelines.high-definition/Editor/Sky/AtmosphericScattering/FogEditor.cs --- .../Lighting/Shadow/ContactShadowsEditor.cs | 29 +++++++++---------- .../Sky/AtmosphericScattering/FogEditor.cs | 26 ++++++++--------- 2 files changed, 25 insertions(+), 30 deletions(-) diff --git a/com.unity.render-pipelines.high-definition/Editor/Lighting/Shadow/ContactShadowsEditor.cs b/com.unity.render-pipelines.high-definition/Editor/Lighting/Shadow/ContactShadowsEditor.cs index 8f365d80abc..a97685d796e 100644 --- a/com.unity.render-pipelines.high-definition/Editor/Lighting/Shadow/ContactShadowsEditor.cs +++ b/com.unity.render-pipelines.high-definition/Editor/Lighting/Shadow/ContactShadowsEditor.cs @@ -40,22 +40,19 @@ public override void OnInspectorGUI() if (!m_Enable.value.hasMultipleDifferentValues) { - using (new EditorGUI.DisabledGroupScope(!m_Enable.value.boolValue)) - { - PropertyField(m_Length, EditorGUIUtility.TrTextContent("Length", "Controls the length of the rays HDRP uses to calculate Contact Shadows. Uses meters.")); - PropertyField(m_DistanceScaleFactor, EditorGUIUtility.TrTextContent("Distance Scale Factor", "Dampens the scale up effect HDRP process with distance from the Camera.")); - m_MinDistance.value.floatValue = Mathf.Clamp(m_MinDistance.value.floatValue, 0.0f, m_MaxDistance.value.floatValue); - PropertyField(m_MinDistance, EditorGUIUtility.TrTextContent("Min Distance", "Sets the distance from the camera at which HDRP begins to fade in Contact Shadows. Uses meters.")); - PropertyField(m_MaxDistance, EditorGUIUtility.TrTextContent("Max Distance", "Sets the distance from the Camera at which HDRP begins to fade out Contact Shadows. Uses meters.")); - m_FadeInDistance.value.floatValue = Mathf.Clamp(m_FadeInDistance.value.floatValue, 0.0f, m_MaxDistance.value.floatValue); - PropertyField(m_FadeInDistance, EditorGUIUtility.TrTextContent("Fade In Distance", "Sets the distance over which HDRP fades Contact Shadows in when past the Min Distance. Uses meters.")); - PropertyField(m_FadeDistance, EditorGUIUtility.TrTextContent("Fade Out Distance", "Sets the distance over which HDRP fades Contact Shadows out when at the Max Distance. Uses meters.")); - PropertyField(m_Opacity, EditorGUIUtility.TrTextContent("Opacity", "Controls the opacity of the Contact Shadow.")); - base.OnInspectorGUI(); - GUI.enabled = useCustomValue; - PropertyField(m_SampleCount, EditorGUIUtility.TrTextContent("Sample Count", "Controls the number of samples HDRP uses for ray casting.")); - GUI.enabled = true; - } + PropertyField(m_Length, EditorGUIUtility.TrTextContent("Length", "Controls the length of the rays HDRP uses to calculate Contact Shadows. Uses meters.")); + PropertyField(m_DistanceScaleFactor, EditorGUIUtility.TrTextContent("Distance Scale Factor", "Dampens the scale up effect HDRP process with distance from the Camera.")); + m_MinDistance.value.floatValue = Mathf.Clamp(m_MinDistance.value.floatValue, 0.0f, m_MaxDistance.value.floatValue); + PropertyField(m_MinDistance, EditorGUIUtility.TrTextContent("Min Distance", "Sets the distance from the camera at which HDRP begins to fade in Contact Shadows. Uses meters.")); + PropertyField(m_MaxDistance, EditorGUIUtility.TrTextContent("Max Distance", "Sets the distance from the Camera at which HDRP begins to fade out Contact Shadows. Uses meters.")); + m_FadeInDistance.value.floatValue = Mathf.Clamp(m_FadeInDistance.value.floatValue, 0.0f, m_MaxDistance.value.floatValue); + PropertyField(m_FadeInDistance, EditorGUIUtility.TrTextContent("Fade In Distance", "Sets the distance over which HDRP fades Contact Shadows in when past the Min Distance. Uses meters.")); + PropertyField(m_FadeDistance, EditorGUIUtility.TrTextContent("Fade Out Distance", "Sets the distance over which HDRP fades Contact Shadows out when at the Max Distance. Uses meters.")); + PropertyField(m_Opacity, EditorGUIUtility.TrTextContent("Opacity", "Controls the opacity of the Contact Shadow.")); + base.OnInspectorGUI(); + GUI.enabled = useCustomValue; + PropertyField(m_SampleCount, EditorGUIUtility.TrTextContent("Sample Count", "Controls the number of samples HDRP uses for ray casting.")); + GUI.enabled = true; } } } diff --git a/com.unity.render-pipelines.high-definition/Editor/Sky/AtmosphericScattering/FogEditor.cs b/com.unity.render-pipelines.high-definition/Editor/Sky/AtmosphericScattering/FogEditor.cs index ce918bb696b..26a6e07fb47 100644 --- a/com.unity.render-pipelines.high-definition/Editor/Sky/AtmosphericScattering/FogEditor.cs +++ b/com.unity.render-pipelines.high-definition/Editor/Sky/AtmosphericScattering/FogEditor.cs @@ -106,22 +106,20 @@ public override void OnInspectorGUI() if (volumetricLightingAvailable) { PropertyField(m_EnableVolumetricFog, s_EnableVolumetricFog); - if (m_EnableVolumetricFog.value.boolValue) + + EditorGUI.indentLevel++; + PropertyField(m_Albedo, s_AlbedoLabel); + PropertyField(m_Anisotropy, s_AnisotropyLabel); + PropertyField(m_GlobalLightProbeDimmer, s_GlobalLightProbeDimmerLabel); + + if (isInAdvancedMode) { - EditorGUI.indentLevel++; - PropertyField(m_Albedo, s_AlbedoLabel); - PropertyField(m_Anisotropy, s_AnisotropyLabel); - PropertyField(m_GlobalLightProbeDimmer, s_GlobalLightProbeDimmerLabel); - - if (isInAdvancedMode) - { - PropertyField(m_DepthExtent); - PropertyField(m_SliceDistributionUniformity); - PropertyField(m_Filter); - } - - EditorGUI.indentLevel--; + PropertyField(m_DepthExtent); + PropertyField(m_SliceDistributionUniformity); + PropertyField(m_Filter); } + + EditorGUI.indentLevel--; } } } From 2e77bbfad232d3cba0b47b9bc89fb998a1eae6b8 Mon Sep 17 00:00:00 2001 From: Julien Ignace Date: Thu, 14 May 2020 12:01:41 +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 d31f1a2bc1f..b399f4a93d6 100644 --- a/com.unity.render-pipelines.high-definition/CHANGELOG.md +++ b/com.unity.render-pipelines.high-definition/CHANGELOG.md @@ -17,6 +17,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - Fixed a null ref exception in static sky when the default volume profile is invalid. - Fixed an error about procedural sky being logged by mistake. - Fixed flickering of the game/scene view when lookdev is running. +- Removed logic in the UI to disable parameters for contact shadows and fog volume components as it was going against the concept of the volume system. ### Changed - Shadowmask and realtime reflection probe property are hide in Quality settings