I don't think this is possible just using the color setting in SpriteBatch, so I'm trying to work out a simple shader that would take every pixel and make it white, while respecting the alpha value of the pixel.
The answer Joel Martinez gave looks right, but how do I incorporate that when I draw the sprite with SpriteBatch?
I think this is what you're looking for
sampler2D baseMap;
struct PS_INPUT
{
float2 Texcoord : TEXCOORD0;
};
float4 ps_main( PS_INPUT Input ) : COLOR0
{
float4 color = tex2D( baseMap, Input.Texcoord );
return float4(1.0f, 1.0f, 1.0f, color.w);
}
It's very simple, it just takes the sampled color from the texture, and then returns an all white color using the texture's alpha value.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With