Original Post
Hello, after reading a lot of papers and tutorials I finnally put some shadow mapping together in my D3D app. I use the nvidia style method with a depth texture. Can anyone tell me if the following steps are correct? 1.) I render from the light's point of view using the light's concatenated lightview*lightprojection matrix (M1) to the depth texture. The projection is orthogonal as I use a directional light.(I tested this and it looked quite as it should) 2.) I render from the camera with it's own transformation: camview*camprojection. In the vertex shader I generate 4D texture coordinates for the shadow map by transforming each vertex coordinates (world space) by a matrix M2 that is: M1*M_tex M_tex is the texture offset matrix from the nvidia shadow mapping paper: 0.5 0 0 0 0 -0.5 0 0 0 0 1 0 OffsetX OffsetY bias 1 In the pixel shader of step 2 I do a lookup into the shadow map and display the result as color to see what would be in shadow. The problem is that it looks totally scewed up. Am I missing something important? Thank you in advance. Markus