From 932482f43d2c8a7b59a42952f5a76e5dba0341bf Mon Sep 17 00:00:00 2001 From: Robert Cupisz Date: Mon, 29 Mar 2021 14:54:52 +0200 Subject: [PATCH] Fix spot light near plane gizmo --- .../Editor/Lighting/HDLightUI.Handles.cs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/com.unity.render-pipelines.high-definition/Editor/Lighting/HDLightUI.Handles.cs b/com.unity.render-pipelines.high-definition/Editor/Lighting/HDLightUI.Handles.cs index 10b5e9904ff..b64580a4c67 100644 --- a/com.unity.render-pipelines.high-definition/Editor/Lighting/HDLightUI.Handles.cs +++ b/com.unity.render-pipelines.high-definition/Editor/Lighting/HDLightUI.Handles.cs @@ -187,9 +187,8 @@ static void DrawSpotlightWireframe(Vector3 outerAngleInnerAngleRange, float shad if (shadowPlaneDistance > 0) { - var shadowDiscRadius = shadowPlaneDistance * Mathf.Sin(outerAngle * Mathf.Deg2Rad * 0.5f); - var shadowDiscDistance = Mathf.Cos(Mathf.Deg2Rad * outerAngle / 2) * shadowPlaneDistance; - Handles.DrawWireDisc(Vector3.forward * shadowDiscDistance, Vector3.forward, shadowDiscRadius); + var shadowDiscRadius = shadowPlaneDistance * Mathf.Tan(outerAngle * Mathf.Deg2Rad * 0.5f); + Handles.DrawWireDisc(Vector3.forward * shadowPlaneDistance, Vector3.forward, shadowDiscRadius); } }