Hey people,
I''m on Fedora 24, Firefox 50
and every WebGL VideoTexture renders upside down since I upgraded to the newest Firefox version
Replicable even on the PIXI Demo page:
https://pixijs.github.io/examples/#/basics/video.js

It's the correct way on my PC and on my laptop. Both on Windows.
@themoonrat I can reproduce this on three different computers.
Make sure you have Firefox 50. It might be a Firefox bug as it only happens after newest changes in firefox but http://krpano.com/ios/bugs/ios8-webgl-video/ is not affected. So what is pixi doing differently?
Systems tested:
I tried on Firefox 50 and Firefox Developer Edition 52 on both. PC using Geforce 770 Ti, the laptop... not sure off hand, i believe it's a low end mobile Geforce
@themoonrat are you sure pixi is using the webgl renderer?
I found out that this only happens if gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, true) is called. Also, I was able to reproduce this problem without using pixi.js, so I'm sure this is an browser issue.
To work around this, you can change this line to glTexture.premultiplyAlpha = false. I'm not sure how this will affect transparent images, but since almost all videos don't have alpha channel, it could check whether if the source type is video or not.
So this would work as a complete workaround:
glTexture.premultiplyAlpha = !(texture.source instanceof HTMLVideoElement);
UPDATE: Chrome supports VP8 video alpha channel, while Firefox doesn't.
@yoo2001818 Thank you so very much!
Could you help me to solve this problem? I couldn't reproduce your solution this in pixi.min.js
function PlayGameVideo(lastVideo) {
var texture = PIXI.Texture.fromVideo(lastVideo);
videoSprite = new PIXI.Sprite(texture);
texture.baseTexture.source.loop = true;
videoSprite.width = 720;
videoSprite.height = 480;
videoSprite.anchor.set(0.5);
stage.addChild(videoSprite);
video.currentTime = 0;
video.play();
}
Closing this since it has been answered.
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.
Most helpful comment
I found out that this only happens if
gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, true)is called. Also, I was able to reproduce this problem without using pixi.js, so I'm sure this is an browser issue.To work around this, you can change this line to
glTexture.premultiplyAlpha = false. I'm not sure how this will affect transparent images, but since almost all videos don't have alpha channel, it could check whether if the source type is video or not.So this would work as a complete workaround:
UPDATE: Chrome supports VP8 video alpha channel, while Firefox doesn't.