Skip to content

Fix WebGL alpha blending #7769

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

Merged
merged 1 commit into from
Apr 22, 2025
Merged

Fix WebGL alpha blending #7769

merged 1 commit into from
Apr 22, 2025

Conversation

davepagurek
Copy link
Contributor

Resolves #7768

Changes:

When taking in a tint, the tint alpha also has to be multiplied with the other tint components.

We actually used to have this, but I "simplified" (broke) this when making a change to hide premultiplied alpha for shader hooks users. I actually even added tests before, but happened to pick test colors that are already maxed out, so you wouldn't be able to tell whether there was a problem or not. (I've updated the tests now to have some non-maxed out colors so that we can catch this if it breaks in the future.)

Screenshots of the change:

Before:
image

After:
image

Live: https://editor.p5js.org/davepagurek/sketches/MAOyCH3Hp

PR Checklist

@davepagurek davepagurek merged commit 3738e3b into dev-2.0 Apr 22, 2025
2 checks passed
@davepagurek davepagurek deleted the fix/webgl-alpha branch April 22, 2025 22:27
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

Successfully merging this pull request may close these issues.

1 participant