From 523ec1dae36ed1ac69cb1bf7fe2911aa5837b5b9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Vauchelles?= Date: Thu, 11 Jun 2020 11:38:46 +0200 Subject: [PATCH] Fixed blend distance editing (1248931) --- .../CHANGELOG.md | 1 + .../Lighting/Reflection/HDProbeUI.Drawers.cs | 1 - .../Volume/InfluenceVolumeUI.Drawers.cs | 16 ++++------------ 3 files changed, 5 insertions(+), 13 deletions(-) diff --git a/com.unity.render-pipelines.high-definition/CHANGELOG.md b/com.unity.render-pipelines.high-definition/CHANGELOG.md index 101179d5f4d..fe3a8e2b399 100644 --- a/com.unity.render-pipelines.high-definition/CHANGELOG.md +++ b/com.unity.render-pipelines.high-definition/CHANGELOG.md @@ -671,6 +671,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - Fixed an issue where decals were duplicated in prefab isolation mode. - Fixed an issue where rendering preview with MSAA might generate render graph errors. - Fixed compile error in PS4 for planar reflection filtering. +- Appropriately constraint blend distance of reflection probe while editing with the inspector (case 1248931) ### Changed - Improve MIP selection for decals on Transparents diff --git a/com.unity.render-pipelines.high-definition/Editor/Lighting/Reflection/HDProbeUI.Drawers.cs b/com.unity.render-pipelines.high-definition/Editor/Lighting/Reflection/HDProbeUI.Drawers.cs index 3cba949c92c..81286155f03 100644 --- a/com.unity.render-pipelines.high-definition/Editor/Lighting/Reflection/HDProbeUI.Drawers.cs +++ b/com.unity.render-pipelines.high-definition/Editor/Lighting/Reflection/HDProbeUI.Drawers.cs @@ -233,7 +233,6 @@ public static void DrawCustomSettings(SerializedHDProbe serialized, Editor owner public static void DrawInfluenceSettings(SerializedHDProbe serialized, Editor owner) { - var provider = new TProvider(); InfluenceVolumeUI.Draw(serialized.probeSettings.influence, owner); } diff --git a/com.unity.render-pipelines.high-definition/Editor/Lighting/Reflection/Volume/InfluenceVolumeUI.Drawers.cs b/com.unity.render-pipelines.high-definition/Editor/Lighting/Reflection/Volume/InfluenceVolumeUI.Drawers.cs index 9e4443bbc2e..f1f9eb3f08e 100644 --- a/com.unity.render-pipelines.high-definition/Editor/Lighting/Reflection/Volume/InfluenceVolumeUI.Drawers.cs +++ b/com.unity.render-pipelines.high-definition/Editor/Lighting/Reflection/Volume/InfluenceVolumeUI.Drawers.cs @@ -173,18 +173,10 @@ static void Drawer_AdvancedBlendDistance(SerializedInfluenceVolume serialized, b } else { - float scalar = editorSimplifiedModeBlendDistance.floatValue; - if (!(Mathf.Approximately(blendDistancePositive.vector3Value.x, scalar) - && Mathf.Approximately(blendDistancePositive.vector3Value.y, scalar) - && Mathf.Approximately(blendDistancePositive.vector3Value.z, scalar) - && Mathf.Approximately(blendDistanceNegative.vector3Value.x, scalar) - && Mathf.Approximately(blendDistanceNegative.vector3Value.y, scalar) - && Mathf.Approximately(blendDistanceNegative.vector3Value.z, scalar))) - { - blendDistancePositive.vector3Value = blendDistanceNegative.vector3Value = new Vector3(scalar, scalar, scalar); - serialized.Apply(); - SceneView.RepaintAll(); //update gizmo - } + var scalar = Mathf.Min(editorSimplifiedModeBlendDistance.floatValue, Mathf.Min(maxBlendDistance.x, maxBlendDistance.y, maxBlendDistance.z)); + blendDistancePositive.vector3Value = blendDistanceNegative.vector3Value = new Vector3(scalar, scalar, scalar); + serialized.Apply(); + SceneView.RepaintAll(); //update gizmo } if (serialized.editorAdvancedModeEnabled.boolValue)