Slight improvements

This commit is contained in:
Michael Riegger
2021-04-26 16:16:05 -07:00
parent 569c831532
commit bbae3b6d48
2 changed files with 6 additions and 12 deletions
@@ -101,20 +101,14 @@ void ApplyPointLight(ViewSrg::PointLight light, Surface surface, inout LightingD
{
const float3 Directions[6] = {float3(0,0,1), float3(0,0,-1), float3(0,1,0), float3(0,-1,0), float3(1,0,0), float3(-1,0,0)};
const int shadowDirectionIndex = GetShadowDirectionIndex(surface.position, light.m_position);
{
litRatio *= ProjectedShadow::GetVisibility(
GetShadowIndex(light, shadowDirectionIndex),
const int shadowIndex = GetShadowIndex(light, shadowDirectionIndex);
litRatio *= ProjectedShadow::GetVisibility(
shadowIndex,
light.m_position,
surface.position,
Directions[shadowDirectionIndex],
surface.normal);
}
/*
// Use backShadowRatio to carry thickness from shadow map for thick mode
backShadowRatio = 1.0 - litRatio;
if (o_transmission_mode == TransmissionMode::ThickObject)
@@ -122,7 +116,7 @@ void ApplyPointLight(ViewSrg::PointLight light, Surface surface, inout LightingD
backShadowRatio = ProjectedShadow::GetThickness(
shadowIndex,
surface.position);
} */
}
}
@@ -234,7 +234,7 @@ namespace AZ
ProjectedShadowFeatureProcessorInterface::ProjectedShadowDescriptor desc = m_shadowFeatureProcessor->GetShadowProperties(shadowId);
Vector3 position = Vector3::CreateFromFloat3(pointLight.m_position.data());
desc.m_fieldOfViewYRadians = 1.58825f;
desc.m_fieldOfViewYRadians = DegToRad(90.5f); // Make it slightly larger than 90 degrees to avoid artifacts on the boundary between 2 cubemap faces
desc.m_transform = Transform::CreateLookAt(position, position + m_directions[i]);
desc.m_aspectRatio = 1.0f;
desc.m_nearPlaneDistance = 0.1f;