sampler sampler0: register(s0);
sampler sampler1: register(s1);
float4 color_for_alpha : register(c3); // Passed through to the BatchRenderer::Draw call

float4 main(float4 col0 : COLOR0,
            float4 col1 : COLOR1,
            float4 tex0 : TEXCOORD0) : COLOR
{

    float4 tex = tex2D(sampler0, tex0.xy);

    float3 fillCol = col0.rgb;
    float3 fillTex = tex2D(sampler1, tex0.zw);
    fillCol *= fillTex;

    float fillAlpha = col0.a*tex.r;

    float3 outlineCol = col1.rgb;
    float outlineAlpha = col1.a*tex.b;

    float3 glowCol = float3(0,0,0);
    float glowAlpha = tex.g;

    float3 col = fillCol * fillAlpha + outlineCol * outlineAlpha + glowCol * glowAlpha;
    float alpha = fillAlpha+outlineAlpha;

    return float4(col,alpha*color_for_alpha.a);
}
