From e13b9ca8295dbae208ce1a1f819fc5a195910542 Mon Sep 17 00:00:00 2001 From: Ken Pruiksma Date: Thu, 1 Jul 2021 21:49:32 -0500 Subject: [PATCH] [ATOM-15926] Fixing light delegates which were always calculating the attenuation radius automatically for their debug display instead of respecting the user-set attenuation radius. (#1732) Signed-off-by: Ken Pruiksma --- .../Code/Source/CoreLights/CapsuleLightDelegate.cpp | 2 +- .../Code/Source/CoreLights/PolygonLightDelegate.cpp | 2 +- .../Code/Source/CoreLights/QuadLightDelegate.cpp | 2 +- .../Code/Source/CoreLights/SimplePointLightDelegate.cpp | 4 ++-- .../Code/Source/CoreLights/SphereLightDelegate.cpp | 4 ++-- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/CapsuleLightDelegate.cpp b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/CapsuleLightDelegate.cpp index 4b9a9b0223..e8257acef0 100644 --- a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/CapsuleLightDelegate.cpp +++ b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/CapsuleLightDelegate.cpp @@ -69,7 +69,7 @@ namespace AZ if (isSelected) { // Attenuation radius shape is just a capsule with the same internal height, but a radius of the attenuation radius. - float radius = CalculateAttenuationRadius(AreaLightComponentConfig::CutoffIntensity); + float radius = GetConfig()->m_attenuationRadius; // Add on the caps for the attenuation radius float scale = GetTransform().GetUniformScale(); diff --git a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/PolygonLightDelegate.cpp b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/PolygonLightDelegate.cpp index 1db22b4ad8..0a712dda47 100644 --- a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/PolygonLightDelegate.cpp +++ b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/PolygonLightDelegate.cpp @@ -79,7 +79,7 @@ namespace AZ debugDisplay.SetColor(color); // Draw a Polygon for the attenuation radius - debugDisplay.DrawWireSphere(transform.GetTranslation(), CalculateAttenuationRadius(AreaLightComponentConfig::CutoffIntensity)); + debugDisplay.DrawWireSphere(transform.GetTranslation(), GetConfig()->m_attenuationRadius); debugDisplay.DrawArrow(transform.GetTranslation(), transform.GetTranslation() + transform.GetBasisZ()); } } diff --git a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/QuadLightDelegate.cpp b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/QuadLightDelegate.cpp index b69df642c9..1818088d2d 100644 --- a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/QuadLightDelegate.cpp +++ b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/QuadLightDelegate.cpp @@ -65,7 +65,7 @@ namespace AZ debugDisplay.SetColor(color); // Draw a quad for the attenuation radius - debugDisplay.DrawWireSphere(transform.GetTranslation(), CalculateAttenuationRadius(AreaLightComponentConfig::CutoffIntensity)); + debugDisplay.DrawWireSphere(transform.GetTranslation(), GetConfig()->m_attenuationRadius); } } diff --git a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/SimplePointLightDelegate.cpp b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/SimplePointLightDelegate.cpp index b2835c7dd9..ce198eb8e2 100644 --- a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/SimplePointLightDelegate.cpp +++ b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/SimplePointLightDelegate.cpp @@ -48,9 +48,9 @@ namespace AZ if (isSelected) { debugDisplay.SetColor(color); - + // Draw a sphere for the attenuation radius - debugDisplay.DrawWireSphere(transform.GetTranslation(), CalculateAttenuationRadius(AreaLightComponentConfig::CutoffIntensity)); + debugDisplay.DrawWireSphere(transform.GetTranslation(), GetConfig()->m_attenuationRadius); } } } // namespace Render diff --git a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/SphereLightDelegate.cpp b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/SphereLightDelegate.cpp index 6ade4347f3..5d5ed4c11d 100644 --- a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/SphereLightDelegate.cpp +++ b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/SphereLightDelegate.cpp @@ -53,9 +53,9 @@ namespace AZ if (isSelected) { debugDisplay.SetColor(color); - + // Draw a sphere for the attenuation radius - debugDisplay.DrawWireSphere(transform.GetTranslation(), CalculateAttenuationRadius(AreaLightComponentConfig::CutoffIntensity)); + debugDisplay.DrawWireSphere(transform.GetTranslation(), GetConfig()->m_attenuationRadius); } }