//!HLSL


///////////////////////////////////////////////////////////////////////  
// Shader Output Structures


struct BlurVSOutput
{
    float4	_position				: POSITION;
    float2	_uv						: TEXCOORD0;
 };


///////////////////////////////////////////////////////////////////////  
// Blur Vertex Shader, not inspiring

BlurVSOutput BlurVS(float4 vPosition : POSITION )						
{
	BlurVSOutput ret;
	
	ret._position = vPosition * 2;
	ret._position.z = 0;
	ret._position.w = 1;
	ret._uv = (vPosition + .5);
	ret._uv.y = 1-ret._uv.y;
	
	return ret;
}

#if LOWEND
#define SAMPLE_COUNTY  3
#else
#define SAMPLE_COUNTY  6
#endif



float4 BlurPS( BlurVSOutput In,
			   uniform float kernelSize,
			   uniform sampler reflectionTexture ): COLOR
{
	float4 retColor = float4(0,0,0,1);
	
	float2 uv = In._uv;
	uv.y -= SAMPLE_COUNTY/2 * kernelSize;	
	
	for ( int i = 0; i < SAMPLE_COUNTY; i++ )
	{
		retColor += tex2D( reflectionTexture, uv );
		uv.y += kernelSize;
	}
	
	
	
	retColor = retColor/(SAMPLE_COUNTY);
	
	return retColor;
}





