texture g_texture;

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

float PixelSizeX=0.001f;
float PixelSizeY=0.001f;
float BlurAmount=0.000f;


static const float BlurWeights[5] = 
{
	0.100,
    0.200,
    0.400,
    0.200,
    0.100,
};


// level intro shader - just blur and contrast ?
float4 BlurHorizontal( float2 Tex : TEXCOORD0 ) : COLOR0
{

    float4 Color=0;
        
    for (int i = 0; i < 5; i++)
    {    
        Color += tex2D( g_samSrcColor, Tex + float2( (i-2)*PixelSizeX*BlurAmount , 0.0f )  ) * BlurWeights[i];
    }
    
 	Color.a = 1.0f;

    return Color;
}

float4 BlurVertical( float2 Tex : TEXCOORD0 ) : COLOR0
{

    float4 Color=0;
        
    for (int i = 0; i < 5; i++)
    {    
        Color += tex2D( g_samSrcColor, Tex + float2( 0.0f,  (i-2)*PixelSizeY*BlurAmount )  ) * BlurWeights[i];
    }
    
 	Color.a = 1.0f;

    return Color;
}

technique PostProcess
{
    pass p0
    {
        VertexShader = null;
        PixelShader = compile ps_2_0 BlurHorizontal();
    }
    
    pass p1
    {
        VertexShader = null;
        PixelShader = compile ps_2_0 BlurVertical();
    }
    

}