How to do smooth Alpha channel keying with Silverlight 3 Pixel Shaders?
I want some HLSL filter (like this Shazzam HLSL example)
sampler2D implicitInputSampler : register(S0);
float4 main(float2 uv : TEXCOORD) : COLOR
{
float4 color = tex2D( implicitInputSampler, uv );
if( color.r + color.g + color.b < 1.9 ) {
color.rgba = 0;
}
return color;
}
to key not just the color I’m trying to key but for example if dark red consists of red and blue and I’m keying all blue i want to get transparent red. (Probably this picture can explain what do I want)