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

BlendMode alpha fix. #5739

Merged
merged 5 commits into from
May 30, 2019
Merged

BlendMode alpha fix. #5739

merged 5 commits into from
May 30, 2019

Conversation

ivanpopelyshev
Copy link
Collaborator

@ivanpopelyshev ivanpopelyshev commented May 29, 2019

Broken: https://www.pixiplayground.com/#/edit/wh4NJRXJqWCcI87N8lB03
Fixed: https://www.pixiplayground.com/#/edit/2LB0thwrX8EQM5iE7SXN~

Output in Flash runtime:
image

This is not the breaking change: in most of cases ADD was applied on opaque backdrop, and when people use it on transparent background they see the difference:

#5677
#5673
#5446

This is the final answer on BlendMode ADD problem.

Sometimes when I look many hours on the same line, when I know there's a bug but I dont see it. I knew about that effect and thanks to several people I deduced that something is wrong with my memory and sight.

Call it brain blind zone. Call it memory hash collision. Such things happen.

After blackboxing and making more tests with Adobe Flash, I finally found that brain glitch.

I do not know how the heck gl.DST_ALPHA appeared in one of coefficients. maybe it was before my time in pixijs. Somehow, at some point of time I changed ADD in my private fork to correct one [gl.ONE, gl.ONE], but I forgot to push it into vanilla pixijs!

That's why I thought that pixijs vanilla ADD is correct, I even answered to multiple people that having completely transparent geometry add over half-transparent background actually changes the color. I recommended to use custom blendMode with [gl.ONE, gl.ONE] as workaround, completely forgetting that its actually the correct one from my private fork!

Related PR: #5562

I thank @hsienwei, @SergiyTopalov , @distinctdan and others who drew my attention to the problem.

non-premultiplied add fail. really?
@ivanpopelyshev ivanpopelyshev added 🕷 Bug Verified that it’s actually a legit bug that exists in the current release. Version: v5.x labels May 29, 2019
@bigtimebuddy bigtimebuddy added this to the v5.0.4 milestone May 29, 2019
@bigtimebuddy bigtimebuddy merged commit f73b106 into dev May 30, 2019
@bigtimebuddy bigtimebuddy deleted the dev-blendmode-add-again branch August 17, 2019 00:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🕷 Bug Verified that it’s actually a legit bug that exists in the current release.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants