I have encountered the following (i think) precision error.
#version 100
precision mediump float;
uniform sampler2D tex_diff;
uniform vec2 light_on_screen;
varying vec2 texture_coord;
const int NUM_SAMPLES = 128;
void main()
{
const float exposure = 0.0225;
const float decay = 0.95;
const float density = 0.95;
const float weight = 3.75;
// Inner used values
vec2 deltaTextCoord = vec2(texture_coord.st - light_on_screen.xy);
vec2 textCoo = texture_coord.st;
deltaTextCoord *= 1.0 / float(NUM_SAMPLES) * density;
float illuminationDecay = 1.0;
vec4 c = vec4(0, 0, 0, 0);
for(int i=0; i < NUM_SAMPLES ; i++)
{
textCoo -= deltaTextCoord;
textCoo.s = clamp(textCoo.s, 0.0, 1.0);
textCoo.t = clamp(textCoo.t, 0.0, 1.0);
vec4 sample = texture2D(tex_diff, textCoo);
sample *= illuminationDecay * weight;
c += sample;
illuminationDecay *= decay;
}
c *= exposure;
c.r = clamp(c.r, 0.0, 1.0);
c.g = clamp(c.g, 0.0, 1.0);
c.b = clamp(c.b, 0.0, 1.0);
c.a = clamp(c.a, 0.0, 1.0);
gl_FragColor = c;
}