HLSL: Redvision
/*
redvision by Bryce Kerley
makes it black and white except for areas with twice as much red
as both other channels combined
*/
sampler s0 : register(s0);
float4 p0 : register(c0);
#define width (p0[0])
#define height (p0[1])
#define counter (p0[2])
#define clock (p0[3])
#define threshold (0.0)
#define PI acos(-1)
float4 main(float2 tex : TEXCOORD0) : COLOR
{
float4 c0;
//the thresholds are in the float4() function
if(dot(tex2D(s0,tex),float4(.5,-1,-1,0)) >threshold) {
c0 = tex2D(s0,tex);
}
else {
//black and white code yanked from the MPC grayscale filter
c0 = dot(tex2D(s0, tex), float4(0.299, 0.587, 0.114, 0));
}
return c0;
}
This shader was made to use with Media Player Classic.
