#ifdef GL_ES
precision mediump float;
#endif
 
uniform sampler2D u_texture;
 
varying vec2 v_texCoord;
varying vec2 v_blurTexCoords[14];

const float RADIUS = .74;

void main(){

    vec2 p = vec2(0.5, 0.5);

    p.x = v_texCoord.x * RADIUS;
    p.y = v_texCoord.y * RADIUS;

    p.x -= 0.5 * (RADIUS - 1.0);
    p.y -= 0.5 * (RADIUS - 1.0);

    float d = distance(p, vec2(0.5,0.5)) ;
    vec4 texColor = texture2D(u_texture, v_texCoord);



    vec4 col = vec4(0.0);
    col += texture2D(u_texture, v_blurTexCoords[ 0])*0.0044299121055113265;
    col += texture2D(u_texture, v_blurTexCoords[ 1])*0.00895781211794;
    col += texture2D(u_texture, v_blurTexCoords[ 2])*0.0215963866053;
    col += texture2D(u_texture, v_blurTexCoords[ 3])*0.0443683338718;
    col += texture2D(u_texture, v_blurTexCoords[ 4])*0.0776744219933;
    col += texture2D(u_texture, v_blurTexCoords[ 5])*0.115876621105;
    col += texture2D(u_texture, v_blurTexCoords[ 6])*0.147308056121;
    col += texture2D(u_texture, v_texCoord         )*0.159576912161;
    col += texture2D(u_texture, v_blurTexCoords[ 7])*0.147308056121;
    col += texture2D(u_texture, v_blurTexCoords[ 8])*0.115876621105;
    col += texture2D(u_texture, v_blurTexCoords[ 9])*0.0776744219933;
    col += texture2D(u_texture, v_blurTexCoords[10])*0.0443683338718;
    col += texture2D(u_texture, v_blurTexCoords[11])*0.0215963866053;
    col += texture2D(u_texture, v_blurTexCoords[12])*0.00895781211794;
    col += texture2D(u_texture, v_blurTexCoords[13])*0.0044299121055113265;

    col.rgb *= 1.0 - (d/1.2);
//mix(col, texColor, 1.0 - d)
    gl_FragColor = mix(col, texColor, 1.0 - d);
}