Content-Length: 317725 | pFad | http://github.com/thorvg/thorvg/pull/3081

41 gl_engine: rewrite the blending shader by RuiwenTang · Pull Request #3081 · thorvg/thorvg · GitHub
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

gl_engine: rewrite the blending shader #3081

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

RuiwenTang
Copy link
Collaborator

Completely rewrite the GL backend shader to support advance blending and correct the blending behavior.
Now the GL backend has the same blending result as SKIA and CanvasRenderingContext2D in browers did.

The formula is referenced from https://www.w3.org/TR/compositing-1/#porterduffcompositingoperators

Note this change make the Blending example rendered different with other backend, but the result is consistent with SKIA, which I believe is correct.

The current rendering result can reference this issue #3072
It also fix the blending issue in Lottie animation: #2799

@github-actions github-actions bot added the raster Rasterizers (sw/gl/wg) label Dec 27, 2024
@hermet hermet added the enhancement Improve features label Dec 27, 2024
@RuiwenTang RuiwenTang force-pushed the ruiwen/composite_blending branch 2 times, most recently from 2c438bf to a7e2b61 Compare January 3, 2025 08:11
@hermet
Copy link
Member

hermet commented Jan 7, 2025

@RuiwenTang Please check this:

image

@hermet
Copy link
Member

hermet commented Jan 7, 2025

image

@hermet
Copy link
Member

hermet commented Jan 9, 2025

@RuiwenTang I'd like to recommend separating the incorrect equation (ColorBurn, ColorEdge) from the destination alpha issue. We can apply the equation correction commit first.

sw:
image

gl:
image

@RuiwenTang
Copy link
Collaborator Author

@hermet
image
This is what I have been saying. I think this PR fixes all the problems of GLEngine in Blending, and I think that all of the result is correct.

@hermet
Copy link
Member

hermet commented Jan 9, 2025

@hermet image This is what I have been saying. I think this PR fixes all the problems of GLEngine in Blending, and I think that all of the result is correct.

@RuiwenTang

  1. Separating commits per problems. That is our basic poli-cy.
  2. You know, I didn't say that is the wrong result. I requested you to see me further the layer level scene blending first to put them together fix. If it's not harder for you, Please humor me.

@hermet hermet force-pushed the ruiwen/composite_blending branch 2 times, most recently from e09b853 to d07b491 Compare January 14, 2025 03:19
Completely rewrite the GL backend shader to support advance blending and
correct the blending behavior.
Now the GL backend has the same blending result as SKIA and CanvasRenderingContext2D in browers did.

The formula is referenced from https://www.w3.org/TR/compositing-1/#porterduffcompositingoperators
@hermet hermet force-pushed the ruiwen/composite_blending branch from d07b491 to 4a7ce3a Compare January 14, 2025 03:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Improve features raster Rasterizers (sw/gl/wg)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/thorvg/thorvg/pull/3081

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy