From 6dbb8e1794f763302226dce41ff91e99b3b7e875 Mon Sep 17 00:00:00 2001 From: Santi Paprika Date: Thu, 23 Dec 2021 21:02:02 +0100 Subject: [PATCH] Use local shrinked shadow coords (https://github.com/o3de/o3de/pull/6428#discussion_r774255818) Signed-off-by: Santi Paprika --- .../ShaderLib/Atom/Features/PBR/Lighting/LightingData.azsli | 3 --- .../ShaderLib/Atom/Features/PBR/Lights/DirectionalLight.azsli | 4 ++-- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lighting/LightingData.azsli b/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lighting/LightingData.azsli index 7e7af6be96..a1278b8126 100644 --- a/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lighting/LightingData.azsli +++ b/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lighting/LightingData.azsli @@ -28,9 +28,6 @@ class LightingData // Direction light shadow coordinates float3 shadowCoords[ViewSrg::MaxCascadeCount]; - // Direction light shadow coordinates for shrinked positions (used in scattering through thin objects) - float3 shrinkedShadowCoords[ViewSrg::MaxCascadeCount]; - // (N . L) to accept below (N . L = 0) in scattering through thin objects float transmissionNdLBias; diff --git a/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lights/DirectionalLight.azsli b/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lights/DirectionalLight.azsli index e3f3f1135a..e6de9e57c3 100644 --- a/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lights/DirectionalLight.azsli +++ b/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lights/DirectionalLight.azsli @@ -37,7 +37,7 @@ void ApplyDirectionalLights(Surface surface, inout LightingData lightingData) shadowIndex, surface.position - lightingData.shrinkFactor * surface.vertexNormal, surface.normal, - lightingData.shrinkedShadowCoords); + shrinkedShadowCoords); if (o_transmission_mode == TransmissionMode::ThickObject) { @@ -47,7 +47,7 @@ void ApplyDirectionalLights(Surface surface, inout LightingData lightingData) { // Use shrinked positions for thin object transmission to ensure they fall onto the object when querying // the depth from the shadow map - transmissionDistance = DirectionalLightShadow::GetThickness(shadowIndex, lightingData.shrinkedShadowCoords); + transmissionDistance = DirectionalLightShadow::GetThickness(shadowIndex, shrinkedShadowCoords); } }