// * xy-blur

struct fragment
{
	float4 position  : POSITION;
	float4 color0    : COLOR0;
	float2 texcoord0 : TEXCOORD0;
};


void main( in fragment IN,
					 in uniform sampler2D texture,
					 in uniform float xoff,
					 in uniform float yoff,
					 in uniform float alpha,
					 out float4 OUT : COLOR0 )
{
	const float2 DX = float2( xoff, 0.0f );
	const float2 DY = float2( 0.0f, yoff );

	float4 col = float4( 0,0,0,0);
	
	col += tex2D( texture,IN.texcoord0 )	 * 0.25f;

	col += tex2D( texture,IN.texcoord0+DX ) * 0.125f;
	col += tex2D( texture,IN.texcoord0-DX ) * 0.125f;
	col += tex2D( texture,IN.texcoord0+DY ) * 0.125f;
	col += tex2D( texture,IN.texcoord0-DY ) * 0.125f;
	
	col += tex2D( texture,IN.texcoord0+DX+DY ) * 0.0625f;
	col += tex2D( texture,IN.texcoord0-DX-DY ) * 0.0625f;
	col += tex2D( texture,IN.texcoord0+DX-DY ) * 0.0625f;
	col += tex2D( texture,IN.texcoord0-DX+DY ) * 0.0625f;

	OUT = col * alpha;	
}
