
uniform sampler2D Texture0;

uniform float theNrSamples;
uniform float theBlurSize;

uniform float theGausDistribution[50];
uniform float theGausTotal;

void main(void)
{
   vec3 theTotal = vec3( 0.0, 0.0, 0.0);
   
   for (float i = 0; i < theNrSamples; i++)
   {
	float theDistance = theBlurSize * ( -1. + (2*i)/(theNrSamples-1));
       theTotal += theGausDistribution[i] * (texture2D( Texture0, gl_TexCoord[0] + vec2( theDistance, 0.0) ).rgb );
   }

   gl_FragColor =  vec4( theTotal / theGausTotal, 1);
}
