Original Post
Hi, I am following the "Soft-Edged Shadows" tutorial by Anirudh S Shastry: http://www.gamedev.net/reference/articles/article2193.asp When it gets to the part about rendering depth, I tried doing that on my backbuffer instead of on a render target texture. All the meshes I render show up completely white. So it's like all depth values are 1.0f. But they're not. Each mesh drawn is farther away from the camera. Here's my effect file: uniform float4x4 wvp:VIEWPROJECTION; // Shadow generation vertex shader struct VSOUTPUT_SHADOW { float4 vPosition : POSITION; float fDepth : TEXCOORD0; }; VSOUTPUT_SHADOW VS_Shadow( float4 inPosition : POSITION ) { // Output struct VSOUTPUT_SHADOW OUT = (VSOUTPUT_SHADOW)0; // Output the transformed position OUT.vPosition = mul( inPosition, wvp ); // Output the scene depth OUT.fDepth = OUT.vPosition.z; return OUT; } float4 PS_Shadow( VSOUTPUT_SHADOW IN ):COLOR0 { // Output the scene depth return float4( IN.fDepth, IN.fDepth, IN.fDepth, 1.0f ); } technique MyTechnique { pass P0 { VertexShader = compile vs_2_0 VS_Shadow(); PixelShader = compile ps_2_0 PS_Shadow(); } } Am I doing something wrong? (most likely) Is the tutorial wrong? (not so likely)