 
         color += sample * weight;
         total += weight;
+
         if (t > countLimit){
             break;
         }

}

void main() {
    uRadius;
    uMinRadius;

    vec2 texCoord = gl_FragCoord.xy / uViewSize.xy;
    texCoord.y = 1.0 - texCoord.y;

    vec2 dir = vec2(center - texCoord);
    dir.x *= uViewSize.x / uViewSize.y;

    float dist = length(dir);

    float strength = uStrength;

    /* randomize the lookup values to hide the fixed number of samples */
    float offset = random(vec3(12.9898, 78.233, 151.7182), 0.0);

    const float count = 32.0;
    float countLimit = count;

    float gradient = uRadius * 0.3;
    float minGradient = uMinRadius * 0.3;

    float radius = (uRadius - gradient * 0.5) / uViewSize.y;
    float minRadius = (uMinRadius + minGradient * 0.5) / uViewSize.y;

    float delta = 0.0;

    float gap;
    if (dist <  minRadius) {
        delta = minRadius - dist;
        gap = minGradient;
    } else if (dist > radius) {
        delta = dist - radius;
        gap = gradient;
    }

    if (delta > 0.0) {
        float normalCount = gap / uViewSize.y;
        delta = (normalCount - delta) / normalCount;
        countLimit *= delta;
        strength *= delta;
        if (countLimit < 1.0)
        {
            gl_FragColor = texture2D(uSampler, vTextureCoord);
            return;
        }
    }

    dir *= strength;
