//horizontal gaussian blur
#version 120
varying vec2 texCoord;
uniform sampler2D colorMap;

void main (void)
{
    //const float gaussiancoef[11]= float[](0.0f,1.0f,2.0f,3.0f,4.0f,5.0f,4.0f,3.0f,2.0f,1.0f,0.0f);
    //const float gaussiancoef[11]= float[](0.000003,	0.000229,	0.005977,	0.060598,	0.24173,	0.382925,	0.24173,	0.060598,	0.005977,	0.000229,	0.000003);
    vec4 blurredpixel;
    if (texCoord.y<1.0/4.0||texCoord.y>3.0/4.0)
        gl_FragColor = texture2D(colorMap, texCoord);
    //gl_FragColor = vec4(1.0f);
    else
    {
        blurredpixel=vec4(0.0f,0.0f,0.0f,1.0f);
        float y=texCoord.y;
        for (int x=0; x<20; x++)
        {
            float x1=texCoord.x+(-10.0f+x)/1920.0f;
            blurredpixel+=texture2D(colorMap, vec2(x1,y));
        }
//blurredpixel=blurredpixel/(20*20);
        //gl_FragColor = texture2D(colorMap, texCoord)+texture2D(blurMap, texCoord);
        //gl_FragColor = texture2D(blurMap, texCoord)+blurredpixel;//+blurredpixel/2.0f;
        gl_FragColor = blurredpixel/20.0f;//+blurredpixel/2.0f;
    }

}
