From 65a58c713523258a38654a050dd66849a927e025 Mon Sep 17 00:00:00 2001 From: John Parsaie Date: Tue, 1 Dec 2020 15:18:11 -0500 Subject: [PATCH 1/4] Add light unit slider for auto and auto histogram exposure limits, --- .../Editor/PostProcessing/ExposureEditor.cs | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/com.unity.render-pipelines.high-definition/Editor/PostProcessing/ExposureEditor.cs b/com.unity.render-pipelines.high-definition/Editor/PostProcessing/ExposureEditor.cs index b4fc8ca7e38..1fdcb1f2168 100644 --- a/com.unity.render-pipelines.high-definition/Editor/PostProcessing/ExposureEditor.cs +++ b/com.unity.render-pipelines.high-definition/Editor/PostProcessing/ExposureEditor.cs @@ -91,7 +91,7 @@ public override void OnInspectorGUI() } else if (mode == (int)ExposureMode.Fixed) { - DoFixedExposureField(m_FixedExposure); + DoExposurePropertyField(m_FixedExposure); PropertyField(m_Compensation); } else @@ -152,8 +152,8 @@ public override void OnInspectorGUI() } else if (!(mode == (int)ExposureMode.AutomaticHistogram && m_HistogramCurveRemapping.value.boolValue)) { - PropertyField(m_LimitMin); - PropertyField(m_LimitMax); + DoExposurePropertyField(m_LimitMin); + DoExposurePropertyField(m_LimitMax); } PropertyField(m_Compensation); @@ -204,18 +204,18 @@ public override void OnInspectorGUI() } } - // TODO: See if it's possible to refactor into a custom VolumeParameterDrawer - void DoFixedExposureField(SerializedDataParameter fixedExposure) + // TODO: See if this can be refactored into a custom VolumeParameterDrawer + void DoExposurePropertyField(SerializedDataParameter exposureProperty) { using (new EditorGUILayout.HorizontalScope()) { - DrawOverrideCheckbox(fixedExposure); + DrawOverrideCheckbox(exposureProperty); - using (new EditorGUI.DisabledScope(!fixedExposure.overrideState.boolValue)) - EditorGUILayout.LabelField(fixedExposure.displayName); + using (new EditorGUI.DisabledScope(!exposureProperty.overrideState.boolValue)) + EditorGUILayout.LabelField(exposureProperty.displayName); } - using (new EditorGUI.DisabledScope(!fixedExposure.overrideState.boolValue)) + using (new EditorGUI.DisabledScope(!exposureProperty.overrideState.boolValue)) { var xOffset = EditorGUIUtility.labelWidth + 22; var lineRect = EditorGUILayout.GetControlRect(); @@ -225,12 +225,12 @@ void DoFixedExposureField(SerializedDataParameter fixedExposure) var sliderRect = lineRect; sliderRect.y -= EditorGUIUtility.singleLineHeight; k_LightUnitSlider.SetSerializedObject(serializedObject); - k_LightUnitSlider.DrawExposureSlider(m_FixedExposure.value, sliderRect); + k_LightUnitSlider.DrawExposureSlider(exposureProperty.value, sliderRect); - // GUIContent.none disables horizontal scrolling, ur TrTextContent and adjust the rect to make it work + // GUIContent.none disables horizontal scrolling, use TrTextContent and adjust the rect to make it work. lineRect.x -= EditorGUIUtility.labelWidth + 2; lineRect.width += EditorGUIUtility.labelWidth + 2; - EditorGUI.PropertyField(lineRect, m_FixedExposure.value, EditorGUIUtility.TrTextContent(" ")); + EditorGUI.PropertyField(lineRect, exposureProperty.value, EditorGUIUtility.TrTextContent(" ")); } } } From 2b37155e45c0d1a04e0f28a446026e374e78dd94 Mon Sep 17 00:00:00 2001 From: John Parsaie Date: Tue, 1 Dec 2020 15:18:57 -0500 Subject: [PATCH 2/4] Fix the light unit below range caution value tooltip value. --- .../Editor/Lighting/LightUnit/LightUnitSlider.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/com.unity.render-pipelines.high-definition/Editor/Lighting/LightUnit/LightUnitSlider.cs b/com.unity.render-pipelines.high-definition/Editor/Lighting/LightUnit/LightUnitSlider.cs index a5e931857a3..8790b9f9bb6 100644 --- a/com.unity.render-pipelines.high-definition/Editor/Lighting/LightUnit/LightUnitSlider.cs +++ b/com.unity.render-pipelines.high-definition/Editor/Lighting/LightUnit/LightUnitSlider.cs @@ -84,7 +84,7 @@ LightUnitSliderUIRange CurrentRange(float value) } } - var cautionValue = m_Descriptor.sliderRange.y; + var cautionValue = value < m_Descriptor.sliderRange.x ? m_Descriptor.sliderRange.x : m_Descriptor.sliderRange.y; var cautionTooltip = value < m_Descriptor.sliderRange.x ? m_Descriptor.belowRangeTooltip : m_Descriptor.aboveRangeTooltip; return LightUnitSliderUIRange.CautionRange(cautionTooltip, cautionValue); } From ab04f51a18c7c72763bd0743934d80e2266ae38b Mon Sep 17 00:00:00 2001 From: John Parsaie Date: Tue, 1 Dec 2020 15:21:42 -0500 Subject: [PATCH 3/4] Add 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 fe3d4a0a5e8..38b50e706b0 100644 --- a/com.unity.render-pipelines.high-definition/CHANGELOG.md +++ b/com.unity.render-pipelines.high-definition/CHANGELOG.md @@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ### Added - Added a new API to bake HDRP probes from C# (case 1276360) - Added support for pre-exposure for planar reflections. +- Added light unit slider for automatic and automatic histrogram exposure limits. ### Fixed - Fixed probe volumes debug views. From 318b043cf3a4b3606c7614323e54a20d6ea43db8 Mon Sep 17 00:00:00 2001 From: John Parsaie Date: Wed, 2 Dec 2020 09:32:23 -0500 Subject: [PATCH 4/4] Adjust the automatic exposure default limits (after discussion with lighting artist). --- .../Runtime/PostProcessing/Components/Exposure.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Components/Exposure.cs b/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Components/Exposure.cs index 4f44b8f0080..2c8ccad9052 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Components/Exposure.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Components/Exposure.cs @@ -49,14 +49,14 @@ public sealed class Exposure : VolumeComponent, IPostProcessComponent /// This parameter is only used when or is set. /// [Tooltip("Sets the minimum value that the Scene exposure can be set to.")] - public FloatParameter limitMin = new FloatParameter(-10f); + public FloatParameter limitMin = new FloatParameter(-1f); /// /// Sets the maximum value that the Scene exposure can be set to. /// This parameter is only used when or is set. /// [Tooltip("Sets the maximum value that the Scene exposure can be set to.")] - public FloatParameter limitMax = new FloatParameter(20f); + public FloatParameter limitMax = new FloatParameter(14f); /// /// Specifies a curve that remaps the Scene exposure on the x-axis to the exposure you want on the y-axis.