Skip to content

Commit a34f336

Browse files
Fixed range fields for depth of field
1 parent 015d64e commit a34f336

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

com.unity.render-pipelines.high-definition/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
5959
- Fixed Crash issue when adding an area light on its own.
6060
- Fixed rendertarget ColorMask in Forward with virtual texturing and transparent motion vectors.
6161
- Fixed light unit conversion after changing mid gray value.
62+
- Fixed range fields for depth of field (case 1376609).
6263

6364
### Changed
6465
- Use RayTracingAccelerationStructure.CullInstances to filter Renderers and populate the acceleration structure with ray tracing instances for improved CPU performance on the main thread.

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

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,10 +117,25 @@ void DrawFocusSettings(int mode)
117117
}
118118
else if (mode == (int)DepthOfFieldMode.Manual)
119119
{
120+
EditorGUI.BeginChangeCheck();
120121
PropertyField(m_NearFocusStart, Styles.k_NearFocusStart);
122+
if (EditorGUI.EndChangeCheck() && m_NearFocusStart.value.floatValue >= m_NearFocusEnd.value.floatValue && m_NearFocusEnd.overrideState.boolValue)
123+
m_NearFocusStart.value.floatValue = m_NearFocusEnd.value.floatValue - 1e-5f;
124+
125+
EditorGUI.BeginChangeCheck();
121126
PropertyField(m_NearFocusEnd, Styles.k_NearFocusEnd);
127+
if (EditorGUI.EndChangeCheck() && m_NearFocusEnd.value.floatValue <= m_NearFocusStart.value.floatValue && m_NearFocusStart.overrideState.boolValue)
128+
m_NearFocusEnd.value.floatValue = m_NearFocusStart.value.floatValue + 1e-5f;
129+
130+
EditorGUI.BeginChangeCheck();
122131
PropertyField(m_FarFocusStart, Styles.k_FarFocusStart);
132+
if (EditorGUI.EndChangeCheck() && m_FarFocusStart.value.floatValue >= m_FarFocusEnd.value.floatValue && m_FarFocusEnd.overrideState.boolValue)
133+
m_FarFocusStart.value.floatValue = m_FarFocusEnd.value.floatValue - 1e-5f;
134+
135+
EditorGUI.BeginChangeCheck();
123136
PropertyField(m_FarFocusEnd, Styles.k_FarFocusEnd);
137+
if (EditorGUI.EndChangeCheck() && m_FarFocusEnd.value.floatValue <= m_FarFocusStart.value.floatValue && m_FarFocusStart.overrideState.boolValue)
138+
m_FarFocusEnd.value.floatValue = m_FarFocusStart.value.floatValue + 1e-5f;
124139
}
125140
}
126141

0 commit comments

Comments
 (0)