diff --git a/com.unity.render-pipelines.high-definition/CHANGELOG.md b/com.unity.render-pipelines.high-definition/CHANGELOG.md index 6ccbb2aeafb..cf560c00d29 100644 --- a/com.unity.render-pipelines.high-definition/CHANGELOG.md +++ b/com.unity.render-pipelines.high-definition/CHANGELOG.md @@ -853,6 +853,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - Removing the planarReflectionCacheCompressed setting from asset. - SHADERPASS for TransparentDepthPrepass and TransparentDepthPostpass identification is using respectively SHADERPASS_TRANSPARENT_DEPTH_PREPASS and SHADERPASS_TRANSPARENT_DEPTH_POSTPASS - Renamed the debug name from SSAO to ScreenSpaceAmbientOcclusion (1254974). +- Added missing tooltips and improved the UI of the aperture control (case 1254916). +- Fixed wrong tooltips in the Dof Volume (case 1256641). ## [7.1.1] - 2019-09-05 diff --git a/com.unity.render-pipelines.high-definition/Editor/PostProcessing/DepthOfFieldEditor.cs b/com.unity.render-pipelines.high-definition/Editor/PostProcessing/DepthOfFieldEditor.cs index b83fe275edf..b83769a5e4e 100644 --- a/com.unity.render-pipelines.high-definition/Editor/PostProcessing/DepthOfFieldEditor.cs +++ b/com.unity.render-pipelines.high-definition/Editor/PostProcessing/DepthOfFieldEditor.cs @@ -7,6 +7,20 @@ namespace UnityEditor.Rendering.HighDefinition [VolumeComponentEditor(typeof(DepthOfField))] sealed class DepthOfFieldEditor : VolumeComponentWithQualityEditor { + static partial class Styles + { + public static GUIContent k_NearSampleCount = new GUIContent("Sample Count", "Sets the number of samples to use for the near field."); + public static GUIContent k_NearMaxBlur = new GUIContent("Max Radius", "Sets the maximum radius the near blur can reach."); + public static GUIContent k_FarSampleCount = new GUIContent("Sample Count", "Sets the number of samples to use for the far field."); + public static GUIContent k_FarMaxBlur = new GUIContent("Max Radius", "Sets the maximum radius the far blur can reach"); + + public static GUIContent k_NearFocusStart = new GUIContent("Start", "Sets the distance from the Camera at which the near field blur begins to decrease in intensity."); + public static GUIContent k_FarFocusStart = new GUIContent("Start", "Sets the distance from the Camera at which the far field starts blurring."); + + public static GUIContent k_NearFocusEnd = new GUIContent("End", "Sets the distance from the Camera at which the near field does not blur anymore."); + public static GUIContent k_FarFocusEnd = new GUIContent("End", "Sets the distance from the Camera at which the far field blur reaches its maximum blur radius."); + } + SerializedDataParameter m_FocusMode; // Physical mode @@ -74,12 +88,12 @@ public override void OnInspectorGUI() { GUI.enabled = useCustomValue; EditorGUILayout.LabelField("Near Blur", EditorStyles.miniLabel); - PropertyField(m_NearSampleCount, EditorGUIUtility.TrTextContent("Sample Count")); - PropertyField(m_NearMaxBlur, EditorGUIUtility.TrTextContent("Max Radius")); + PropertyField(m_NearSampleCount, Styles.k_NearSampleCount); + PropertyField(m_NearMaxBlur, Styles.k_NearMaxBlur); EditorGUILayout.LabelField("Far Blur", EditorStyles.miniLabel); - PropertyField(m_FarSampleCount, EditorGUIUtility.TrTextContent("Sample Count")); - PropertyField(m_FarMaxBlur, EditorGUIUtility.TrTextContent("Max Radius")); + PropertyField(m_FarSampleCount, Styles.k_FarSampleCount); + PropertyField(m_FarMaxBlur, Styles.k_FarMaxBlur); GUI.enabled = true; } } @@ -88,26 +102,26 @@ public override void OnInspectorGUI() EditorGUILayout.Space(); EditorGUILayout.LabelField("Near Blur", EditorStyles.miniLabel); - PropertyField(m_NearFocusStart, EditorGUIUtility.TrTextContent("Start")); - PropertyField(m_NearFocusEnd, EditorGUIUtility.TrTextContent("End")); + PropertyField(m_NearFocusStart, Styles.k_NearFocusStart); + PropertyField(m_NearFocusEnd, Styles.k_NearFocusEnd); if (advanced) { GUI.enabled = useCustomValue; - PropertyField(m_NearSampleCount, EditorGUIUtility.TrTextContent("Sample Count")); - PropertyField(m_NearMaxBlur, EditorGUIUtility.TrTextContent("Max Radius")); + PropertyField(m_NearSampleCount, Styles.k_NearSampleCount); + PropertyField(m_NearMaxBlur, Styles.k_NearMaxBlur); GUI.enabled = true; } EditorGUILayout.LabelField("Far Blur", EditorStyles.miniLabel); - PropertyField(m_FarFocusStart, EditorGUIUtility.TrTextContent("Start")); - PropertyField(m_FarFocusEnd, EditorGUIUtility.TrTextContent("End")); + PropertyField(m_FarFocusStart, Styles.k_FarFocusStart); + PropertyField(m_FarFocusEnd, Styles.k_FarFocusEnd); if (advanced) { GUI.enabled = useCustomValue; - PropertyField(m_FarSampleCount, EditorGUIUtility.TrTextContent("Sample Count")); - PropertyField(m_FarMaxBlur, EditorGUIUtility.TrTextContent("Max Radius")); + PropertyField(m_FarSampleCount, Styles.k_FarSampleCount); + PropertyField(m_FarMaxBlur, Styles.k_FarMaxBlur); GUI.enabled = true; } } diff --git a/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/Camera/HDCameraUI.Drawers.cs b/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/Camera/HDCameraUI.Drawers.cs index 824406229f7..b87477783d0 100644 --- a/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/Camera/HDCameraUI.Drawers.cs +++ b/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/Camera/HDCameraUI.Drawers.cs @@ -422,7 +422,58 @@ static void Drawer_PhysicalCamera(SerializedHDCamera p, Editor owner) cam.focalLength.floatValue = focalLengthVal; } - EditorGUILayout.PropertyField(p.aperture, apertureContent); + // Custom layout for aperture + var rect = EditorGUILayout.BeginHorizontal(); + { + // Magic values/offsets to get the UI look consistent + const float textRectSize = 80; + const float textRectPaddingRight = 62; + const float unitRectPaddingRight = 97; + const float sliderPaddingLeft = 2; + const float sliderPaddingRight = 77; + + var labelRect = rect; + labelRect.width = EditorGUIUtility.labelWidth; + labelRect.height = EditorGUIUtility.singleLineHeight; + EditorGUI.LabelField(labelRect, apertureContent); + + GUI.SetNextControlName("ApertureSlider"); + var sliderRect = rect; + sliderRect.x += labelRect.width + sliderPaddingLeft; + sliderRect.width = rect.width - labelRect.width - sliderPaddingRight; + float newVal = GUI.HorizontalSlider(sliderRect, p.aperture.floatValue, HDPhysicalCamera.kMinAperture, HDPhysicalCamera.kMaxAperture); + + // keep only 2 digits of precision, like the otehr editor fields + newVal = Mathf.Floor(100 * newVal) / 100.0f; + + if (p.aperture.floatValue != newVal) + { + p.aperture.floatValue = newVal; + // Note: We need to move the focus when the slider changes, otherwise the textField will not update + GUI.FocusControl("ApertureSlider"); + } + + var unitRect = rect; + unitRect.x += rect.width - unitRectPaddingRight; + unitRect.width = textRectSize; + unitRect.height = EditorGUIUtility.singleLineHeight; + EditorGUI.LabelField(unitRect, "f /", EditorStyles.label); + + var textRect = rect; + textRect.x = rect.width - textRectPaddingRight; + textRect.width = textRectSize; + textRect.height = EditorGUIUtility.singleLineHeight; + string newAperture = EditorGUI.TextField(textRect, p.aperture.floatValue.ToString()); + try + { + p.aperture.floatValue = Mathf.Clamp(float.Parse(newAperture), HDPhysicalCamera.kMinAperture, HDPhysicalCamera.kMaxAperture); + } + catch + { } + } + + EditorGUILayout.EndHorizontal(); + EditorGUILayout.Space(EditorGUIUtility.singleLineHeight); EditorGUILayout.PropertyField(cam.lensShift, lensShiftContent); } diff --git a/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/Camera/HDCameraUI.Skin.cs b/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/Camera/HDCameraUI.Skin.cs index d9df6d4c688..ea7610740a9 100644 --- a/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/Camera/HDCameraUI.Skin.cs +++ b/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/Camera/HDCameraUI.Skin.cs @@ -40,13 +40,13 @@ static partial class HDCameraUI static readonly GUIContent renderingPathContent = EditorGUIUtility.TrTextContent("Custom Frame Settings", "Define the custom Frame Settings for this Camera to use."); // TODO: Tooltips - static readonly GUIContent isoContent = EditorGUIUtility.TrTextContent("Iso"); - static readonly GUIContent shutterSpeedContent = EditorGUIUtility.TrTextContent("Shutter Speed"); - static readonly GUIContent apertureContent = EditorGUIUtility.TrTextContent("Aperture"); - static readonly GUIContent bladeCountContent = EditorGUIUtility.TrTextContent("Blade Count"); - static readonly GUIContent curvatureContent = EditorGUIUtility.TrTextContent("Curvature"); - static readonly GUIContent barrelClippingContent = EditorGUIUtility.TrTextContent("Barrel Clipping"); - static readonly GUIContent anamorphismContent = EditorGUIUtility.TrTextContent("Anamorphism"); + static readonly GUIContent isoContent = EditorGUIUtility.TrTextContent("Iso", "Sets the light sensitivity of the Camera sensor. This property affects Exposure if you set its Mode to Use Physical Camera."); + static readonly GUIContent shutterSpeedContent = EditorGUIUtility.TrTextContent("Shutter Speed", "The amount of time the Camera sensor is capturing light."); + static readonly GUIContent apertureContent = EditorGUIUtility.TrTextContent("Aperture", "The f-stop (f-number) of the lens. Lower values give a wider lens aperture."); + static readonly GUIContent bladeCountContent = EditorGUIUtility.TrTextContent("Blade Count", "The number of blades in the lens aperture. Higher values give a rounder aperture shape."); + static readonly GUIContent curvatureContent = EditorGUIUtility.TrTextContent("Curvature", "Controls the curvature of the lens aperture blades. The minimum value results in fully-curved, perfectly-circular bokeh, and the maximum value results in visible aperture blades."); + static readonly GUIContent barrelClippingContent = EditorGUIUtility.TrTextContent("Barrel Clipping", "Controls the self-occlusion of the lens, creating a cat's eye effect."); + static readonly GUIContent anamorphismContent = EditorGUIUtility.TrTextContent("Anamorphism", "Use the slider to stretch the sensor to simulate an anamorphic look."); static readonly GUIContent antialiasingContent = EditorGUIUtility.TrTextContent("Anti-aliasing", "The anti-aliasing method to use."); static readonly GUIContent SMAAQualityPresetContent = EditorGUIUtility.TrTextContent("SMAA Quality Preset", "The quality preset for SMAA, low has the best performance but worst quality, High has the highest quality but worst performance.");