hughel, yeah, but that makes the instruction count triple nearly :-o
I've actually done it like this now, good idea Dave! Thanks.
float4 ps_main(float2 tex : TEXCOORD0) : COLOR0{ float4 black = float4(0.0f, 0.0f, 0.0f, 1.0f);float4 clear = float4(0.0f, 0.0f, 0.0f, 0.0f); float4 val = tex2D(Texture0, tex); if (any(black.rgb + val.rgb)) { return val; } else { return clear; } }
I use black as the key now, so I just add the texel to black and if any component is non-zero it passes the texel through, otherwise sets it transparent. And the instruction count is down to 4! :-D
Cheers guys.