score:2

Accepted answer

you cannot achieve this effect in the fragment shader because you are rendering multiple meshes or primitives. you have to enable blending before rendering the geometry:

gl.enable(gl.blend);
gl.blendfunc(gl.src_alpha, gl.one_minus_src_alpha);

also make sure that the depth test is disabled.

additionally you must set the alpha channel from. e.g.:

gl_fragcolor = vec4(glow, 1.0);

vec4(glow, (glow.r+glow.g.+glow.b)/3.0 * 1.1 - 0.1);

Related Query

More Query from same tag