From 6fde83e3dca89eb28c1e253936f93a3594d2d355 Mon Sep 17 00:00:00 2001 From: Anis Benyoub Date: Fri, 16 Oct 2020 18:29:42 +0200 Subject: [PATCH] Fixed a warning happening when putting the range of lights to 0. --- com.unity.render-pipelines.high-definition/CHANGELOG.md | 1 + .../Editor/Lighting/HDLightUI.cs | 3 +++ 2 files changed, 4 insertions(+) diff --git a/com.unity.render-pipelines.high-definition/CHANGELOG.md b/com.unity.render-pipelines.high-definition/CHANGELOG.md index e4f142d1b14..a0aef9c1931 100644 --- a/com.unity.render-pipelines.high-definition/CHANGELOG.md +++ b/com.unity.render-pipelines.high-definition/CHANGELOG.md @@ -166,6 +166,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - Fixed null reference in the Undo callback of the graphics compositor - Fixed cullmode for SceneSelectionPass. - Fixed issue that caused non-static object to not render at times in OnEnable reflection probes. +- Fixed a warning happening when putting the range of lights to 0. ### Changed - Preparation pass for RTSSShadows to be supported by render graph. diff --git a/com.unity.render-pipelines.high-definition/Editor/Lighting/HDLightUI.cs b/com.unity.render-pipelines.high-definition/Editor/Lighting/HDLightUI.cs index 21a7098c64f..44196c7b289 100644 --- a/com.unity.render-pipelines.high-definition/Editor/Lighting/HDLightUI.cs +++ b/com.unity.render-pipelines.high-definition/Editor/Lighting/HDLightUI.cs @@ -732,6 +732,9 @@ static void DrawEmissionContent(SerializedHDLight serialized, Editor owner) #else serialized.settings.DrawRange(false); #endif + // Make sure the range is not 0.0 + serialized.settings.range.floatValue = Mathf.Max(0.001f, serialized.settings.range.floatValue); + if (EditorGUI.EndChangeCheck()) { // For GI we need to detect any change on additional data and call SetLightDirty + For intensity we need to detect light shape change