   Questions about rendering to the D3DFMT_R32F texture
  Hi.These days i'm learning the ShadowMap Sample. First step, we should get the depth information and write to the D3DFMT_R32F texture, I write the depth information to the "rgba" components of a float4 variable, and output it. and I pick up some texcoord to sample the texture so that i can make sure it works in the right way. Now, here comes the problem. I do think that the color sampled from the texture would be white, black or gray because the four components of a float4 variable contains the same depth value, But the result is very strange(Like the compound of green and blue ).and it seems that every texture coordinate returns the same color value, no dark and light distinguish. Has someone ever been into this kind of situation??Don't know if i make it clear.Frustrated...   
  Have you tried using PIX to inspect the depth buffer before and after each draw call?  Also, which color do you clear the target to at the start of a frame?It can be difficult to discern objects in depth maps visibly due to small contrast differences.  Try shrinking your frustum far distance to help increase the contrast.   ;Quote:Original post by Jason Z which color do you clear the target to at the start of a frame?V( pd3dDevice->Clear( 0L, NULL, D3DCLEAR_TARGET | D3DCLEAR_ZBUFFER, 0x00ff0000, 1.0f, 0L ) );when the red part of the color value is "ff", the texture sampling result is white , but if it is 00 , no matter what kind of color the other part is , the result will be blue and green.More and more confused...;  Oh yeah, I got it.The cause is the progressive mesh, you can't render a PMesh to the texture.