#include "_shared.fx"

technique ambientpass
{
    pass p0
    {
        cullmode = cw;
    }
} 

technique lightpass
{
    pass p0
    {
        cullmode = cw;
        ColorWriteEnable = Red | Green | Blue | Alpha;

        ZEnable = true;
        ZFunc = equal;
        ZWriteEnable = false;

        StencilEnable = false;

        AlphaBlendEnable = true;
        SrcBlend = One;
        DestBlend = One;
    }
    
    pass restore
    {
        ZFunc = less;
        ZWriteEnable = true;
        
        StencilEnable = false;
        AlphaBlendEnable = false;
    }
}



static const int COLORMASK[] = {1, 2, 4, 8};

technique shadowmap
{
    pass p0
    {
        ZEnable = true;
        ColorWriteEnable = COLORMASK[c_iLightIndex];

    }
    
}


technique shadowvolume
{
    pass p0
    {
		PixelShader = NULL;

        ZEnable = true;
        ZWriteEnable = false;

		AlphaTestEnable = false;
		AlphaBlendEnable = false;
    }
    
    pass restore
    {
        ColorWriteEnable = Red | Green | Blue | Alpha;
        ZEnable = true;
    }
}

