Skip to content

Conversation

davepagurek
Copy link
Contributor

Resolves #5854

Changes:

  • Uses the MULTIPLY blend mode settings that Pixi.js uses
  • Updates an existing blend test that ignored alpha (only fully opaque blue multiplied with fully opaque red would yield black; unfortunately, this is how 2D mode works, so this is different than before)
  • Updates tests that check if WebGL blending matches 2D to test with some transparency

Note that 2D and WebGL MULTIPLY modes work differently now! The 2D mode has a bunch of quirks where it blends semi transparent colors with white and makes them opaque before multiplication. This PR chooses to handle MULTIPLY in WebGL in a more expected way. If we decide we want to preserve the existing alpha-ignoring method for everything but text, I can update this code to only use the new blend function when drawing text.

Screenshots of the change:

Before After

PR Checklist

  • npm run lint passes
  • [Inline documentation] is included / updated
  • [Unit tests] are included / updated

@Qianqianye Qianqianye merged commit 7cb329c into processing:main Nov 7, 2022
@davepagurek davepagurek deleted the fix/webgl-multiply branch November 7, 2022 13:52
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.

WebGL blending doesn't always work with transparent textures
2 participants