// Pixel shader input structure struct PS_INPUT { float4 Position : POSITION; float2 Texture : TEXCOORD0; }; // Pixel shader output structure struct PS_OUTPUT { float4 Color : COLOR0; }; // Global variables sampler2D Tex0; float fThreshold; PS_OUTPUT ps_main( in PS_INPUT In ) { // Output pixel PS_OUTPUT Out; Out.Color = tex2D(Tex0, In.Texture); float4 f4 = Out.Color * float4(0.299f, 0.587f, 0.114f, 1.0f); float f = f4.r + f4.g + f4.b; if(f