This is what the scene looks like with shadows turned off (also looks identical to doing a standard Sample):
[attachment=17922:RuinValor 2013-09-17 02-29-53-75.png]
And with the shadow maps on:
[attachment=17923:RuinValor 2013-09-17 02-29-56-55.png]
And again with the debug output:
[attachment=17924:RuinValor 2013-09-17 02-29-58-98.png]
Bottom image is the depth from the player's perspective, middle is the 4 cascades showing the depth from the light's perspective, and the top is the combined shadow map. This is my sampler state:
SamplerComparisonState cmpSampler
{
Filter = COMPARISON_MIN_MAG_MIP_LINEAR;
AddressU = CLAMP;
AddressV = CLAMP;
ComparisonFunc = LESS_EQUAL;
};
And sampling code:return ShadowMap.SampleCmpLevelZero(cmpSampler, shadowTexCoord, lightDepth - SHADOW_BIAS);
If I change to using just a regular sample, there's no problemfloat sample = ShadowMap.Sample(DepthMapSampler, shadowTexCoord).r;
return sample > lightDepth - SHADOW_BIAS;
Any ideas?