#1 You are calling ‘depth’ to the sampler2DShadow and to the return value. #2 You are using in texture2D function a sampler called ‘depthTex’, and you have declared ‘depth’. #3 You are using texture2D function, and for shadow samplers, the fuction is shadow[1|2|3]D[Proj|Lod], and this functions needs a vec3 or vec4 for texture coordinates.
try something like vec4 depthval = shadow2D(depth, gl_TexCoord[0].str);
which doesnt come out right, so i assume im trying to display it incorectly, i get a white screen and seems when i get really close to something i get blackness where there is polys… but really close!
if i change it to be a texture2D and not shadow sampler, it comes up as expected?
so should i treat my depth texture as a regular texture or as a shadow texture?