From 3fff42c5e2e7805a561581e7bbaca506eb572cde Mon Sep 17 00:00:00 2001 From: Pavlos Mavridis Date: Tue, 30 Jun 2020 15:42:51 +0200 Subject: [PATCH 1/9] Added missing tooltips in the physical camera UI --- .../CHANGELOG.md | 1 + .../Documentation~/HDRP-Camera.md | 2 +- .../RenderPipeline/Camera/HDCameraUI.Skin.cs | 14 +++++++------- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/com.unity.render-pipelines.high-definition/CHANGELOG.md b/com.unity.render-pipelines.high-definition/CHANGELOG.md index 6ccbb2aeafb..46a7790ba58 100644 --- a/com.unity.render-pipelines.high-definition/CHANGELOG.md +++ b/com.unity.render-pipelines.high-definition/CHANGELOG.md @@ -853,6 +853,7 @@ 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 in the physical camera UI (case 1254916). ## [7.1.1] - 2019-09-05 diff --git a/com.unity.render-pipelines.high-definition/Documentation~/HDRP-Camera.md b/com.unity.render-pipelines.high-definition/Documentation~/HDRP-Camera.md index eda596badaf..825d933f4c8 100644 --- a/com.unity.render-pipelines.high-definition/Documentation~/HDRP-Camera.md +++ b/com.unity.render-pipelines.high-definition/Documentation~/HDRP-Camera.md @@ -46,7 +46,7 @@ The HDRP Camera shares many properties with the [Standard Unity Camera](https:// | ------------------- | ------------------------------------------------------------ | | **Sensor Type** | Use the drop-down to select the real-world camera format that you want the Camera to simulate. When you select a Camera **Sensor Type**, Unity automatically sets the **Sensor Size** to the correct values for that format. If you change the **Sensor Size** values manually, Unity automatically sets this property to **Custom**. | | **Sensor Size** | Set the size, in millimeters, of the real-world camera sensor. Unity sets the **X** and **Y** values automatically when you select the **Sensor Type**. You can enter custom values to fine-tune your sensor. | -| **ISO** | Set the sensibility of the real-world camera sensor. Higher values increase the Camera's sensitivity to light and result in faster exposure times. This property affects [Exposure](Override-Exposure.html) if you set its **Mode** to **Use Physical Camera**. | +| **ISO** | Set the sensitivity of the real-world camera sensor. Higher values increase the Camera's sensitivity to light and result in faster exposure times. This property affects [Exposure](Override-Exposure.html) if you set its **Mode** to **Use Physical Camera**. | | **Shutter Speed** | Set the exposure time for the camera. Lower values result in less exposed pictures. Use the drop-down to select the units for the exposure time. You can use **Seconds** or **1/Seconds**. This property affects [Exposure](Override-Exposure.html) if you set its **Mode** to **Use Physical Camera**. | | **Gate Fit** | Use the drop-down to select the method that Unity uses to set the size of the resolution gate (aspect ratio of the device you run the application on) relative to the film gate (aspect ratio of the Physical Camera sensor). **Vertical**: Fits the resolution gate to the height of the film gate. If the sensor aspect ratio is larger than the device aspect ratio, Unity crops the rendered image at the sides. If the sensor aspect ratio is smaller than the device aspect ratio, Unity overscans the rendered image at the sides. If you select this method, changing the sensor width (**Sensor Size** > **X** property) has no effect on the rendered image.
• **Horizontal**: Fits the resolution gate to the width of the film gate. If the sensor aspect ratio is larger than the device aspect ratio, Unity overscans the rendered image on the top and bottom. If the sensor aspect ratio is smaller than the device aspect ratio, Unity crops the rendered image on the top and bottom. If you select this method, changing the sensor height (**Sensor Size** > **Y** property) has no effect on the rendered image.
• **Fill**: Fits the resolution gate to either the width or height of the film gate, whichever is smaller. This crops the rendered image.
• **Overscan**: Fits the resolution gate to either the width or height of the film gate, whichever is larger. This overscans the rendered image.
• **None**: Ignores the resolution gate and uses the film gate only. This stretches the rendered image to fit the device aspect ratio. | | **Focal Length** | Set the distance, in millimeters, between the Camera sensor and the Camera lens. Lower values result in a wider **Field of View**, and vice versa. This property affects [Depth of Field](Post-Processing-Depth-of-Field.html) if you set its **Focus Mode** to **Use Physical Camera**. | 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..806986d521b 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 Canera sensor us 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 curvuture 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 efect: the edges of the lens aperture are occluded by the geometry of the lens."); + 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."); From ab67eda5920e3985ff35e28c7c4b44ae1b475b25 Mon Sep 17 00:00:00 2001 From: Pavlos Mavridis Date: Tue, 30 Jun 2020 16:21:05 +0200 Subject: [PATCH 2/9] Fix tooltips for DoF --- .../CHANGELOG.md | 1 + .../PostProcessing/DepthOfFieldEditor.cs | 20 +++++++++++++------ 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/com.unity.render-pipelines.high-definition/CHANGELOG.md b/com.unity.render-pipelines.high-definition/CHANGELOG.md index 46a7790ba58..5aca1f9a49f 100644 --- a/com.unity.render-pipelines.high-definition/CHANGELOG.md +++ b/com.unity.render-pipelines.high-definition/CHANGELOG.md @@ -854,6 +854,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - 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 in the physical camera UI (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..ff87639b4a7 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,14 @@ 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"); + } + SerializedDataParameter m_FocusMode; // Physical mode @@ -74,12 +82,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; } } @@ -106,8 +114,8 @@ public override void OnInspectorGUI() 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; } } From f9506e2d64e0dd22dc60b9b948d4060b2d9b6690 Mon Sep 17 00:00:00 2001 From: Pavlos Mavridis Date: Tue, 30 Jun 2020 16:27:56 +0200 Subject: [PATCH 3/9] Revert doc change --- .../Documentation~/HDRP-Camera.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/com.unity.render-pipelines.high-definition/Documentation~/HDRP-Camera.md b/com.unity.render-pipelines.high-definition/Documentation~/HDRP-Camera.md index 825d933f4c8..eda596badaf 100644 --- a/com.unity.render-pipelines.high-definition/Documentation~/HDRP-Camera.md +++ b/com.unity.render-pipelines.high-definition/Documentation~/HDRP-Camera.md @@ -46,7 +46,7 @@ The HDRP Camera shares many properties with the [Standard Unity Camera](https:// | ------------------- | ------------------------------------------------------------ | | **Sensor Type** | Use the drop-down to select the real-world camera format that you want the Camera to simulate. When you select a Camera **Sensor Type**, Unity automatically sets the **Sensor Size** to the correct values for that format. If you change the **Sensor Size** values manually, Unity automatically sets this property to **Custom**. | | **Sensor Size** | Set the size, in millimeters, of the real-world camera sensor. Unity sets the **X** and **Y** values automatically when you select the **Sensor Type**. You can enter custom values to fine-tune your sensor. | -| **ISO** | Set the sensitivity of the real-world camera sensor. Higher values increase the Camera's sensitivity to light and result in faster exposure times. This property affects [Exposure](Override-Exposure.html) if you set its **Mode** to **Use Physical Camera**. | +| **ISO** | Set the sensibility of the real-world camera sensor. Higher values increase the Camera's sensitivity to light and result in faster exposure times. This property affects [Exposure](Override-Exposure.html) if you set its **Mode** to **Use Physical Camera**. | | **Shutter Speed** | Set the exposure time for the camera. Lower values result in less exposed pictures. Use the drop-down to select the units for the exposure time. You can use **Seconds** or **1/Seconds**. This property affects [Exposure](Override-Exposure.html) if you set its **Mode** to **Use Physical Camera**. | | **Gate Fit** | Use the drop-down to select the method that Unity uses to set the size of the resolution gate (aspect ratio of the device you run the application on) relative to the film gate (aspect ratio of the Physical Camera sensor). **Vertical**: Fits the resolution gate to the height of the film gate. If the sensor aspect ratio is larger than the device aspect ratio, Unity crops the rendered image at the sides. If the sensor aspect ratio is smaller than the device aspect ratio, Unity overscans the rendered image at the sides. If you select this method, changing the sensor width (**Sensor Size** > **X** property) has no effect on the rendered image.
• **Horizontal**: Fits the resolution gate to the width of the film gate. If the sensor aspect ratio is larger than the device aspect ratio, Unity overscans the rendered image on the top and bottom. If the sensor aspect ratio is smaller than the device aspect ratio, Unity crops the rendered image on the top and bottom. If you select this method, changing the sensor height (**Sensor Size** > **Y** property) has no effect on the rendered image.
• **Fill**: Fits the resolution gate to either the width or height of the film gate, whichever is smaller. This crops the rendered image.
• **Overscan**: Fits the resolution gate to either the width or height of the film gate, whichever is larger. This overscans the rendered image.
• **None**: Ignores the resolution gate and uses the film gate only. This stretches the rendered image to fit the device aspect ratio. | | **Focal Length** | Set the distance, in millimeters, between the Camera sensor and the Camera lens. Lower values result in a wider **Field of View**, and vice versa. This property affects [Depth of Field](Post-Processing-Depth-of-Field.html) if you set its **Focus Mode** to **Use Physical Camera**. | From d9d67e702037f359e62fd8a89e90f0d160194f4d Mon Sep 17 00:00:00 2001 From: Pavlos Mavridis Date: Tue, 30 Jun 2020 20:03:17 +0200 Subject: [PATCH 4/9] Custom drawing for the aperture --- .../Camera/HDCameraUI.Drawers.cs | 46 ++++++++++++++++++- .../RenderPipeline/Camera/HDCameraUI.Skin.cs | 4 +- 2 files changed, 47 insertions(+), 3 deletions(-) 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..f14dceea244 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,51 @@ static void Drawer_PhysicalCamera(SerializedHDCamera p, Editor owner) cam.focalLength.floatValue = focalLengthVal; } - EditorGUILayout.PropertyField(p.aperture, apertureContent); + //EditorGUILayout.PropertyField(p.aperture, apertureContent); + var rect = EditorGUILayout.BeginHorizontal(); + { + const float pad = 2; + const float textRectSize = 80; + + var labelRect = rect; + labelRect.width = EditorGUIUtility.labelWidth; + labelRect.height = EditorGUIUtility.singleLineHeight; + EditorGUI.LabelField(labelRect, apertureContent); + + GUI.SetNextControlName("ApertureSlider"); + var sliderRect = rect; + sliderRect.x += EditorGUIUtility.labelWidth + pad; + sliderRect.width = rect.width - EditorGUIUtility.labelWidth - pad - 75; + float newVal = GUI.HorizontalSlider(sliderRect, p.aperture.floatValue, 1.0f, 32); + + // 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 - textRectSize; + unitRect.width = textRectSize; + unitRect.height = EditorGUIUtility.singleLineHeight; + EditorGUI.LabelField(unitRect, "f /", EditorStyles.label); + + var textRect = rect; + textRect.x = rect.width - 62; + textRect.width = textRectSize; + textRect.height = EditorGUIUtility.singleLineHeight; + string newAperture = EditorGUI.TextField(textRect, p.aperture.floatValue.ToString()); + p.aperture.floatValue = (float)Convert.ToDouble(newAperture); + } + + EditorGUILayout.EndHorizontal(); + EditorGUILayout.Space(); + EditorGUILayout.Space(); + EditorGUILayout.Space(); 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 806986d521b..ecd7eff553c 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 @@ -41,11 +41,11 @@ static partial class HDCameraUI // TODO: Tooltips 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 Canera sensor us capturing light."); + 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 curvuture 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 efect: the edges of the lens aperture are occluded by the geometry of the lens."); + 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."); From 27a816c1d42ff850cfc74db7917e482b6fdca384 Mon Sep 17 00:00:00 2001 From: Pavlos Mavridis Date: Tue, 30 Jun 2020 20:18:39 +0200 Subject: [PATCH 5/9] Code cleanup --- .../RenderPipeline/Camera/HDCameraUI.Drawers.cs | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) 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 f14dceea244..124cc3fe906 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 @@ -425,8 +425,12 @@ static void Drawer_PhysicalCamera(SerializedHDCamera p, Editor owner) //EditorGUILayout.PropertyField(p.aperture, apertureContent); var rect = EditorGUILayout.BeginHorizontal(); { - const float pad = 2; + // 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; @@ -435,8 +439,8 @@ static void Drawer_PhysicalCamera(SerializedHDCamera p, Editor owner) GUI.SetNextControlName("ApertureSlider"); var sliderRect = rect; - sliderRect.x += EditorGUIUtility.labelWidth + pad; - sliderRect.width = rect.width - EditorGUIUtility.labelWidth - pad - 75; + sliderRect.x += labelRect.width + sliderPaddingLeft; + sliderRect.width = rect.width - labelRect.width - sliderPaddingRight; float newVal = GUI.HorizontalSlider(sliderRect, p.aperture.floatValue, 1.0f, 32); // keep only 2 digits of precision, like the otehr editor fields @@ -450,13 +454,13 @@ static void Drawer_PhysicalCamera(SerializedHDCamera p, Editor owner) } var unitRect = rect; - unitRect.x = rect.width - textRectSize; + 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 - 62; + textRect.x = rect.width - textRectPaddingRight; textRect.width = textRectSize; textRect.height = EditorGUIUtility.singleLineHeight; string newAperture = EditorGUI.TextField(textRect, p.aperture.floatValue.ToString()); From 40920f65ff3a01cc23fd13c0fe2d453fb934d571 Mon Sep 17 00:00:00 2001 From: Pavlos Mavridis Date: Tue, 30 Jun 2020 22:52:29 +0200 Subject: [PATCH 6/9] Add missing comment --- .../Editor/RenderPipeline/Camera/HDCameraUI.Drawers.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 124cc3fe906..e784978ddd5 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,7 @@ 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 From 74ac42e9dee3ba90632e9d98b4abeeace815ef9a Mon Sep 17 00:00:00 2001 From: Pavlos Mavridis Date: Tue, 30 Jun 2020 22:56:10 +0200 Subject: [PATCH 7/9] Changelog --- com.unity.render-pipelines.high-definition/CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/com.unity.render-pipelines.high-definition/CHANGELOG.md b/com.unity.render-pipelines.high-definition/CHANGELOG.md index 5aca1f9a49f..cf560c00d29 100644 --- a/com.unity.render-pipelines.high-definition/CHANGELOG.md +++ b/com.unity.render-pipelines.high-definition/CHANGELOG.md @@ -853,7 +853,7 @@ 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 in the physical camera UI (case 1254916). +- 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 From da432c5c54ec5e2916a9d5339a1a22159b333499 Mon Sep 17 00:00:00 2001 From: Pavlos Mavridis Date: Tue, 30 Jun 2020 23:32:21 +0200 Subject: [PATCH 8/9] Clamp the aperture to the correct range, avoid using hard-coded constants --- .../RenderPipeline/Camera/HDCameraUI.Drawers.cs | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) 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 e784978ddd5..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 @@ -441,7 +441,7 @@ static void Drawer_PhysicalCamera(SerializedHDCamera p, Editor owner) var sliderRect = rect; sliderRect.x += labelRect.width + sliderPaddingLeft; sliderRect.width = rect.width - labelRect.width - sliderPaddingRight; - float newVal = GUI.HorizontalSlider(sliderRect, p.aperture.floatValue, 1.0f, 32); + 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; @@ -464,13 +464,16 @@ static void Drawer_PhysicalCamera(SerializedHDCamera p, Editor owner) textRect.width = textRectSize; textRect.height = EditorGUIUtility.singleLineHeight; string newAperture = EditorGUI.TextField(textRect, p.aperture.floatValue.ToString()); - p.aperture.floatValue = (float)Convert.ToDouble(newAperture); + try + { + p.aperture.floatValue = Mathf.Clamp(float.Parse(newAperture), HDPhysicalCamera.kMinAperture, HDPhysicalCamera.kMaxAperture); + } + catch + { } } EditorGUILayout.EndHorizontal(); - EditorGUILayout.Space(); - EditorGUILayout.Space(); - EditorGUILayout.Space(); + EditorGUILayout.Space(EditorGUIUtility.singleLineHeight); EditorGUILayout.PropertyField(cam.lensShift, lensShiftContent); } From bfae79010d24620ca64a8e0049ecdae381b8e353 Mon Sep 17 00:00:00 2001 From: Pavlos Mavridis Date: Wed, 1 Jul 2020 10:36:49 +0200 Subject: [PATCH 9/9] Fixed more tooltips + typo --- .../PostProcessing/DepthOfFieldEditor.cs | 18 ++++++++++++------ .../RenderPipeline/Camera/HDCameraUI.Skin.cs | 2 +- 2 files changed, 13 insertions(+), 7 deletions(-) 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 ff87639b4a7..b83769a5e4e 100644 --- a/com.unity.render-pipelines.high-definition/Editor/PostProcessing/DepthOfFieldEditor.cs +++ b/com.unity.render-pipelines.high-definition/Editor/PostProcessing/DepthOfFieldEditor.cs @@ -13,6 +13,12 @@ static partial class Styles 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; @@ -96,20 +102,20 @@ 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) { 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 ecd7eff553c..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 @@ -44,7 +44,7 @@ static partial class HDCameraUI 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 curvuture 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 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.");