Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect implementation of alpha in shader #9

Open
pineapplemachine opened this issue Jan 22, 2019 · 0 comments
Open

Incorrect implementation of alpha in shader #9

pineapplemachine opened this issue Jan 22, 2019 · 0 comments

Comments

@pineapplemachine
Copy link

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);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant