Reverse depth is now working in the shadow pass
This commit is contained in:
@@ -27,7 +27,7 @@ ParameterBlock<LightCullingData> pLightCullingData;
|
||||
|
||||
static const float4x4 biasMat = float4x4(
|
||||
0.5, 0.0, 0.0, 0.5,
|
||||
0.0, -0.5, 0.0, 0.5,
|
||||
0.0, 0.5, 0.0, 0.5,
|
||||
0.0, 0.0, 1.0, 0.0,
|
||||
0.0, 0.0, 0.0, 1.0);
|
||||
|
||||
@@ -46,7 +46,7 @@ float4 fragmentMain(in FragmentParameter params) : SV_Target
|
||||
{
|
||||
uint cascadeIndex = 0;
|
||||
for (uint c = 0; c < NUM_CASCADES - 1; ++c) {
|
||||
if (params.position_VS.z > pShadowMapping.cascadeSplits[c]) {
|
||||
if (params.position_VS.z < pShadowMapping.cascadeSplits[c]) {
|
||||
cascadeIndex = c + 1;
|
||||
}
|
||||
}
|
||||
@@ -68,7 +68,7 @@ float4 fragmentMain(in FragmentParameter params) : SV_Target
|
||||
if (shadowCoord.z > 0.0 && shadowCoord.z < 1.0)
|
||||
{
|
||||
float dist = pShadowMapping.shadowMaps[cascadeIndex].Sample(pShadowMapping.shadowSampler, float3(shadowCoord.xy + float2(dx * x, dy * y), i)).r;
|
||||
if (shadowCoord.w > 0 && dist > shadowCoord.z)
|
||||
if (shadowCoord.w > 0 && dist < shadowCoord.z)
|
||||
{
|
||||
shadow = 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user