uniform float blur;
uniform sampler2D colorMap;


float define = blur * 100.0 - 300.0;
vec2 TexelKernel[13];
float BlurWeights[13];

void main (void)
{
	int i=0;
	
	TexelKernel[0] = vec2 (-6, 0 );
    TexelKernel[1] = vec2 (-5, 0 );
    TexelKernel[2] = vec2 (-4, 0 );
    TexelKernel[3] = vec2 (-3, 0 );
    TexelKernel[4] = vec2 (-2, 0 );
    TexelKernel[5] = vec2 (-1, 0 );
    TexelKernel[6] = vec2 ( 0, 0 );
    TexelKernel[7] = vec2 ( 1, 0 );
    TexelKernel[8] = vec2 ( 2, 0 );
    TexelKernel[9] = vec2 ( 3, 0 );
    TexelKernel[10] = vec2 ( 4, 0 );
    TexelKernel[11] = vec2 ( 5, 0 );
    TexelKernel[12] = vec2 ( 6, 0 );
	
    BlurWeights[0] = 0.002216;
    BlurWeights[1] = 0.008764;
    BlurWeights[2] = 0.026995;
    BlurWeights[3] = 0.064759;
    BlurWeights[4] = 0.120985;
    BlurWeights[5] = 0.176033;
    BlurWeights[6] = 0.199471;
    BlurWeights[7] = 0.176033;
    BlurWeights[8] = 0.120985;
    BlurWeights[9] = 0.064759;
    BlurWeights[10] = 0.026995;
    BlurWeights[11] = 0.008764;
    BlurWeights[12] = 0.002216;
    
    vec4 color = vec4(0.0);

    for (i = 0; i < 13; i++)
    {
        color += texture2D( colorMap, gl_TexCoord[0].st + TexelKernel[i] /define) * BlurWeights[i];
    }
    gl_FragColor = color;
}