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
Video .webm textures not clearing alpha, causing artifacts #7836
Comments
My apologies, this is not due to Pixi at all, but rather the encoding of the .webm asset. https://www.pixiplayground.com/#/edit/xiB6wlEPquEwU8FFoWQjb As you can see in this playground example, I'm toggling between:
and
The difference is staggering. |
Hello, |
in filter everything is premultiplied anyway, the video is re-renderedd in temp framebuffer before it goes to filter. There's a trick to get non-premultipleid info there, but are you sure you need it? You can use mesh-shader instead of filter and it'll get non-premultiplied info from texture , though you still have to output premultiplied in it |
Normaly video is rendered in FBO. |
that way you'll get NPM in FBO. Even then, if you change gl_FragColor, to tell filter that your result is non-premultiplied but it has to be multiplied to get mixed with background - Welcome to webgl and pma/non-pma. Only pixi can deal with that, other renderers wont even give you those options. ========= alternatively, use mesh-shader. |
PMA is main mode in Web & 2D . You cant use linear texture filtering on non-pma it will look bad. also non-pma means all your blending modes based on porter-duff wont work. Thus, most of renderers are built around PMA. to add any support of NPM is difficult. |
Too many artefact with filter.blendMode = PIXI.BLEND_MODES.NORMAL_NPM |
It's the same with mesh shader always artefact ! |
hm We had a case like a bit before (FBO + shader non-pma), so we had to try all modes and then think why its working :) ==== alternatively: just use PMA everywhere. divide by alpha when npm is needed, make sure the result is pma |
quad.blendMode = PIXI.BLEND_MODES.NORMAL_NPM; |
At this point , I have to ask you to post whole demo in a separate issue, because this thing is not easy. I told you what we did with other project and its possible, i cant proceeed without a demo i can just hack into |
With filter.blendMode = PIXI.BLEND_MODES.NORMAL_NPM, it works fine ! |
Suddenly, it works :) Congratulations! |
Hello,
After Issue 3526 was closed, it appeared as if this was fixed for a time, but it has since returned. Perhaps an update to the way Chromium handles playing .webm files causes this, but in any case this issue still remains.
As per this discussion, various people have tried to raise the issue after it was marked as stale in Issue 4089, and after it was missed in a related issue on the Pixi GL Core Repo.
From my experimentations, it appears that the current implementation simply does not clear the alpha after rendering frames, causing these rendering artifacts:
Playground examples: - white background added to demonstrate alpha difference
pixi.js
version: 6.0.4Tested Environments
The text was updated successfully, but these errors were encountered: