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

Make Framebuffer match alpha settings of the parent context #6

Merged
merged 1 commit into from
Mar 20, 2022

Conversation

davepagurek
Copy link
Owner

Fixes #5

In p5 1.4.1, WebGL graphics/canvases default to not having an alpha channel to make alpha blending less confusing by default (thanks @SableRaf for finding this!) Previously, p5.Framebuffer would always have an alpha channel, leading to unexpected results in p5 1.4.1.

After this change:

  • The framebuffer will create an alpha channel if and only if the WebGL context it's attached to has one
  • The example sketch calls background(255) after clear(), since the behaviour of clear() looks different from v1.4.0 to v1.4.1 if you don't also set a background color

@davepagurek davepagurek merged commit c45c5b5 into main Mar 20, 2022
@davepagurek davepagurek deleted the fix/p51.4.1 branch March 20, 2022 12:43
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.

Example sketch looks different in p5.js 1.4.1
1 participant