bool AlphaTest;
bool AlphaBlend;
float4 Color;

texture Texture;
sampler STex = sampler_state
{
    Texture = <Texture>;
    AddressU = Wrap;
    AddressV = Wrap;
    MipFilter = NONE;
    MagFilter = LINEAR;
    MinFilter = LINEAR;
    //MaxAnisotropy = 1;
};

float4 PSTex(float2 TexC : TEXCOORD0) : COLOR
{
    return tex2D(STex, TexC);
}

float4 PSColor() : COLOR
{
    return Color;
}

float4 PSTexColor(float2 TexC : TEXCOORD0) : COLOR
{
    return tex2D(STex, TexC) * Color;
}

float4 PSTexVertColor(float2 TexC : TEXCOORD0, float4 Diff : COLOR0) : COLOR
{
    return tex2D(STex, TexC) * Diff;
}

stateblock StdStates = stateblock_state
{
    CullMode = NONE;
    ZEnable = false;
    ZWriteEnable = false;
        
    AlphaBlendEnable = <AlphaBlend>;
    AlphaTestEnable = <AlphaTest>;
    AlphaRef = 0;
    AlphaFunc = GREATER;
    SrcBlend = SRCALPHA;
    DestBlend = INVSRCALPHA;
};

technique RenderTex
{
    pass P0
    {
        StateBlock = (StdStates);
    
        VertexShader = null;
        PixelShader  = compile ps_2_0 PSTex();
    }
}

technique RenderColor
{
    pass P0
    {
        StateBlock = (StdStates);
    
        VertexShader = null;
        PixelShader  = compile ps_2_0 PSColor();
    }
}

technique RenderTexColor
{
    pass P0
    {
        StateBlock = (StdStates);
    
        VertexShader = null;
        PixelShader  = compile ps_2_0 PSTexColor();
    }
}

technique RenderTexVertColor
{
    pass P0
    {
        StateBlock = (StdStates);
    
        VertexShader = null;
        PixelShader  = compile ps_2_0 PSTexVertColor();
    }
}


