Depth Map resolution shifting
- by user3669538
the problem is with shadow mapping as you can see,
actually it works fine but in a certain condition that the Depth Map size must be equal to the size of rendering buffer, I use an infinite directional light
so if the window is 800x600 the depth map must be 800x600, and when i change the size of the shadow map to be 900x600 it starts to be shifted and when it's size be 1024x1024 it also shifts till it disappears
the GLSL shadow function
float calcShadow(sampler2D Dmap, vec4 coor){
vec4 sh = vec4((coor.xyz/coor.w),1);
sh.z *= 0.9;
return step(sh.z,texture2D(Dmap,sh.xy).r);
}
here's the result when it's the same size as the window
Colored result & Depth Map
and here's the shifted result, as you can notice the depth map is exactly as the previous one with the addition of white space to the right.
Colored result
http://goo.gl/5lYIFV
Depth Map
http://goo.gl/7320Dd