sampler s0; float4 PixelShaderFunction(float2 coords: TEXCOORD0) : COLOR0 { float4 color = tex2D(s0, coords); if (color.r > .65) color.r = 1; else if (color.r < .35) color.r = 0; return color; } technique Technique1 { pass Pass1 { PixelShader = compile ps_3_0 PixelShaderFunction(); } }