Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upGitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
More blendmodes #5391
More blendmodes #5391
Conversation
|
With WEBGL2.0 we get more out of box support for other blend modes right? Stuff like screen? Or does that still require renderTexture/shader hacks. |
remove NONE patch
|
Something is very wrong with canvas renderer blendModes, I'm working on it. WebGL ones are working. |
|
According to example and masking, we have to add extra clip for canvas renderer to handle 5 of new blendmodes, both in Graphics and Sprite. Its interesting that this problem was solved in Mozilla Shumway canvas2d renderer. |
|
Unfortunately, use of |
|
OK, I did optimization suggested by @GoodBoyDigital |
|
nice man! one final tweak :D |
| this.gl.blendFuncSeparate(mode[0], mode[1], mode[2], mode[3]); | ||
| gl.blendFuncSeparate(mode[0], mode[1], mode[2], mode[3]); | ||
| } | ||
| if (mode.length === 6) |
GoodBoyDigital
Jan 28, 2019
Member
can we stick this if inside the else above?
can we stick this if inside the else above?
ivanpopelyshev
Jan 28, 2019
Author
Member
no, because there's else branch for that if too
no, because there's else branch for that if too
|
fair point! |
|
I looked through it one more time, seems clean. |
|
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Ready for review!
Example: https://www.pixiplayground.com/#/edit/Y3HeuBbbllstbzsfp5g8t
There's no
SUBTRACTblendMode for canvas2d.Some blendModes require extra
clipon canvas2d.Code of CanvasSpriteRenderer is improved, slightly.
Aliases:
DST_OUTakaERASEis the best eraser, it also does not requireclipon canvas2d!SRC_OVERis our default normal blendMode.