texture g_texture;

sampler2D g_samSrcColor =
sampler_state
{
    Texture = <g_texture>;
};

float4 ZombiePS( float2 Tex : TEXCOORD0 ) : COLOR0
{

	float4 Color = tex2D( g_samSrcColor, Tex );

	float4 Avg = (Color.r + Color.g + Color.b + Color.a) / 4.0;

	// Change skin colour here.. maybe.
	if (  Color.g >  Color.r &&  Color.g >  Color.b )
	{
		 Color.g *= 0.5;
		 Color.r *= 0.7;
		 Color.b *= 0.5;
	}

	Color = Avg * 0.70 + Color * 0.30;
	
	Color -= 0.2;
	Color *= 1.5;

	Color.a *= 2;

    return Color;
}


technique PostProcess
{
    pass p0
    {
        VertexShader = null;
        PixelShader = compile ps_2_0 ZombiePS();
    }   

}