Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 1 addition & 0 deletions com.unity.render-pipelines.high-definition/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
- Added a cameraCullingResult field in Custom Pass Context to give access to both custom pass and camera culling result.
- Added a slider to control the fallback value of the directional shadow when the cascade have no coverage.
- Added a toggle to allow to include or exclude smooth surfaces from ray traced reflection denoising.
- Added light unit slider for automatic and automatic histrogram exposure limits.

### Fixed
- Fixed probe volumes debug views.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ public override void OnInspectorGUI()
}
else if (mode == (int)ExposureMode.Fixed)
{
DoFixedExposureField(m_FixedExposure);
DoExposurePropertyField(m_FixedExposure);
PropertyField(m_Compensation);
}
else
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could be good to actually do it. This should be doable AFAIK. It'll let user the possibility to use this in their volume inspectors. Here it is not usable to users.

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();
Expand All @@ -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(" "));
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,14 @@ public sealed class Exposure : VolumeComponent, IPostProcessComponent
/// This parameter is only used when <see cref="ExposureMode.Automatic"/> or <see cref="ExposureMode.CurveMapping"/> is set.
/// </summary>
[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);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note be sure to launch graphics test :)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Launched!


/// <summary>
/// Sets the maximum value that the Scene exposure can be set to.
/// This parameter is only used when <see cref="ExposureMode.Automatic"/> or <see cref="ExposureMode.CurveMapping"/> is set.
/// </summary>
[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);

/// <summary>
/// Specifies a curve that remaps the Scene exposure on the x-axis to the exposure you want on the y-axis.
Expand Down