Use local shrinked shadow coords (https://github.com/o3de/o3de/pull/6428#discussion_r774255818)
Signed-off-by: Santi Paprika <santi.gonzalez.cs@gmail.com>
This commit is contained in:
-3
@@ -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;
|
||||
|
||||
|
||||
+2
-2
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user