pixi-sdf-text
pixi-sdf-text copied to clipboard
Incorrect implementation of alpha in shader
I was looking through the code in this repo and noticed https://github.com/PixelsCommander/pixi-sdf-text/blob/master/src/sdf.frag#L23
gl_FragColor = vec4(color, alpha) * u_alpha;
This causes the RGB channels to also be multiplied by the alpha value, darkening the color as it becomes less opaque.
What was almost certainly the intended behavior would be better represented as:
gl_FragColor = vec4(color, alpha * u_alpha);