Hey all,
I sorted out my matrices (previous topic), but I am having problems with applying the shadows on the scene...
So I have a shadow map computed as:
float4 shadowpos = mul(float4(inputpos,1.0), modelMatrix);
shadowpos = mul(shadowpos, shadowVPMatrix);
return shadowpos;
And it renders a plausible shadow map.
Now in my lighting pass, I am doing:
float shadow = 1.0;
float4 lightspacePos = mul(float4(worldpos, 1.0),shadowVPMatrix);
float shadowSample = shadowmap.Sample(sampler, lightspacePos.xy).r;
if (compareforshadow(lightspacePos.z, shadowSample ))
{
shadow = 0.0;
}
Again i am very sorry if this is a stupid question, this are really my first steps in this field :(
Thank you!!
Jacques