///////////// // GLOBALS // ///////////// Texture2D shaderTexture : register(t0); SamplerState SampleType : register(s0); ////////////// // TYPEDEFS // ////////////// struct PixelInputType { float4 position : SV_POSITION; float2 tex : TEXCOORD0; }; //////////////////////////////////////////////////////////////////////////////// // Pixel Shader //////////////////////////////////////////////////////////////////////////////// float4 DepthPixelShader(PixelInputType input) : SV_TARGET { float depth = input.position.z / input.position.w; depth = 1.0f - depth; return float4(depth, depth, depth, 1.0f); }