// identity float time=0; float sampleDist = 1.0f/512.0f; // distance one pixel in u/v float grayLevel = 0.075; sampler2D image : register(s0); float4 main( float4 Pos : POSITION, float2 texCoord: TEXCOORD0) : COLOR { float4 img = tex2D(image, texCoord); // convert to gray float gray = dot(img, float4(0.30f, 0.59f, 0.11f, 0.0f)); if (gray <=grayLevel) img.a = 0; // img.a * pow(gray/grayLevel,2); return img; }