Normally when you do SpriteBatch.Draw
you can specify a color. But here's the problem. If I use custom shaders they ignore color passed by SpriteBatch.Draw
...
How do I take that into account? I mean how exactly SpriteBatch.Draw
passes a color? If I know it I can use it in my shader.
So far what I have (relevant part):
float4 NoEffects(float2 coords: TEXCOORD0) : COLOR0
{
return tex2D(s0, coords);
}
technique Default
{
pass Pass1
{
PixelShader = compile ps_2_0 NoEffects();
}
}
You need to retrieve the color that's passed through the vertex shader and use it when calculating your final output:
float4 NoEffects(float4 color : COLOR0, float2 coords : TEXCOORD0) : COLOR0
{
return tex2D(s0, coords) * color;
}