Texture TargetMap;
sampler2D g_samSrcColor = sampler_state { texture = <TargetMap>; MipFilter = Linear;	};

float4 vecViewPort;

float4 postprocessing_gaussian(float2 Tex : TEXCOORD0) : COLOR0 
{   
   float4 sampleM  = tex2D(g_samSrcColor, Tex.xy);
	float4 sampleB0 = tex2D( g_samSrcColor, Tex.xy - vecViewPort.zw );
	float4 sampleF0 = tex2D( g_samSrcColor, Tex.xy + vecViewPort.zw );
	float4 sampleB1 = tex2D( g_samSrcColor, Tex.xy - vecViewPort.zw*2. );
	float4 sampleF1 = tex2D( g_samSrcColor, Tex.xy + vecViewPort.zw*2. );
	float4 sampleB2 = tex2D( g_samSrcColor, Tex.xy - vecViewPort.zw*3. );
	float4 sampleF2 = tex2D( g_samSrcColor, Tex.xy + vecViewPort.zw*3. );
	
	return 0.1752 * sampleM + 0.1658 * (sampleB0 + sampleF0) + 0.1403 * (sampleB1 + sampleF1) + 0.1063 * (sampleB2 + sampleF2);
}

technique PostProcess 
{
	pass p1 
	{
		AlphaBlendEnable = false;	
		VertexShader = null;
		PixelShader = compile ps_2_0 postprocessing_gaussian();
	}
}
