three.js icon indicating copy to clipboard operation
three.js copied to clipboard

Transparent video texture showing previous frames

Open bradsimantel opened this issue 12 years ago • 14 comments

I'm experiencing an issue with a plane with a (transparent .webm) video texture. The video is of a cell rotating in place, and every frame is getting drawn on top of the previous one. Since the video is partially transparent, you can see the previous frames behind the current one. Any suggestions on how to make sure the last frame gets removed before drawing the next one?

Here's the pertinent bit of code: https://gist.github.com/bradsimantel/10168393

And a screenshot: screenshot

bradsimantel avatar Apr 08 '14 21:04 bradsimantel

As stated in the guidelines, help requests should be directed to stackoverflow. This board is for bugs and feature requests.

mrdoob avatar Apr 08 '14 21:04 mrdoob

I thought it might be an issue with how Three.js updates textures - drawing on top of the previous frame rather than refreshing it. In any case, sorry!

bradsimantel avatar Apr 08 '14 23:04 bradsimantel

It may be a bug. But better to figure it out if it's a bug or not on stackoverflow.

mrdoob avatar Apr 08 '14 23:04 mrdoob

http://stackoverflow.com/questions/22948498/three-js-transparent-video-texture-showing-previous-frames

Ok. So it does indeed seem that it's an issue with the library. We had never dealt with transparent videos before.

Thanks for providing a example! (http://jsfiddle.net/4ndDB/)

mrdoob avatar Apr 11 '14 23:04 mrdoob

Works for me in FF but with black background and does not work in Chrome but without the black frame. Just saying :)

GuyGood avatar Apr 14 '14 20:04 GuyGood

Works for me in FF but with black background and does not work in Chrome but without the black frame.

I bet that's because FF doesn't support webm with transparency yet.

mrdoob avatar Apr 14 '14 20:04 mrdoob

Interesting: Chrome Canary 37.x.xxx.x seems to have the artifacting problem, Canary 38.0.2124.0 resolves it, and then 39.x.xxx.x breaks it again for me.

brbcoding avatar Sep 10 '14 19:09 brbcoding

Any updates to this issue? On Chrome 43, transparent webm videos are rendering the alpha channel as black and drawing all frames on top of each other. In FF 37, the video frames look right, but the alpha channel is also black.

thelucre avatar May 17 '15 19:05 thelucre

@thelucre Transparent webm videos work fine for me on OSX Chrome 42. Post a simple example on stackoverflow if you need help and show all your code.

WestLangley avatar May 18 '15 01:05 WestLangley

Ah, it looks like videoTexture.format = THREE.RGBFormat was breaking the alpha. Confirmed working in Chrome 43. Thank you, @WestLangley

thelucre avatar May 19 '15 01:05 thelucre

@thelucre oh, so this is fixed?

mrdoob avatar May 20 '15 18:05 mrdoob

@mrdoob I am not sure it was broken.

WestLangley avatar May 20 '15 18:05 WestLangley

@WestLangley You're right! @mrdoob It's working as intended in Chrome. Thank you both.

thelucre avatar May 20 '15 18:05 thelucre

Well, I'm not sure about the original issue of this post. I never saw a live demo using a recent version of the library.

WestLangley avatar May 20 '15 18:05 WestLangley