The renderer is fully premultiplied, meaning the color rgb values are multiplied by their alpha components. For example 50% opacity red is actually (0.5, 0, 0, 0.5), and will still render as full brightness red at 50% opacity instead of a dark "half red" at 50% opacity due to the renderer blend configuration. It's easy to mess up premultiplied alpha in shaders.
I can't figure out why right now but there seems to be some kind of built in fog calculation which screws up the premultiplied alpha. I don't know why that would need to be in the shader anyway, since if it's linear you can fake it easily with a sprite. If you remove the fog then the alpha blend works correctly.
Just replace the last few (broken) lines of the shader:
vec4 color = texture2D(samplerFront, vec2(mod(xx * scale_x, 1.0), mod(yy * scale_y, 1.0)));
//add some fog in the distance
gl_FragColor = vec4(color.rgb/color.a, color.a*(abs(pz)*15.0));[/code:5se2x7m3]
with this, which skips the fog calculation:
[code:5se2x7m3]gl_FragColor = texture2D(samplerFront, vec2(mod(xx * scale_x, 1.0), mod(yy * scale_y, 1.0)));[/code:5se2x7m3]
Top tip: GPUs aren't good at conditionals. The shader would probably be a lot faster on low-end hardware if the "single_image" conditional were removed. It could be made as two separate shaders instead, each with the mode hard coded on/off. Then you have a blazing fast shader: one texture lookup per fragment, no conditionals, no loops... it should even run well on mobile!