I try to implement a simple shadow shader in my project. The shadow map and the basic shader works fine.
When I get to the shadow shader itself, i get a weird issue. When I want to transform the position in the vertex shader with the light view-projection matrix, i get only x and y values. The z and w values are always 1. But when I transform the position with the camera view-projection I get some z and w values. This is my test code for my issue. The output color is always white, which however must be gray, as the values in the shadow map are also gray:
I ran that code in PIX, and I saw that my vertex shader calculates the "Light" value (for all 4 values) write.
When it comes to my pixel shader, it seems like all my values exept "pos" was reseted.
But I still don't know where my fault is.
I saw in PIX that the z value of "pos" is 10 times smaller than the value of it in the vertex shader (Don't ask me. I don't know why)
So I add a new variable to my shadow map pixel shader input struct, where i save the "real" depth values of the pixel and it's solved
It seems like these values are not 0, they are only 10 times smaller than the "pos" value.