struct VS_to_PS { float4 position : SV_POSITION; float4 depthPosition : TEXTURE0; }; float4 DepthPixelShader(VS_to_PS input) : SV_TARGET { float depthValue = input.depthPosition.z / input.depthPosition.w; float4 color = float4(depthValue, depthValue, depthValue, 1.0f); return color; }