You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was using multiple VideoTexture for a project and I realize that even if all the videos were paused, I was getting a huge drops of fps.
So I did a little bit of research and I've seen that all the textures are updated with the this.needsUpdate = true; at every frames, which shouldn't be required since the videos were paused and nothing needed to be updated in my case.
I've overriden the VideoTexture.update() method by adding a condition to prevent calls if the video is paused and the fps increased to 60.
Maybe it would be nice to add an option to not call the "needsUpdate = true" if the video is paused which seems to add a lot of calculations. Something like :
VideoTexture.prototype = Object.assign( Object.create( Texture.prototype ), {
constructor: VideoTexture,
isVideoTexture: true,
update: function () {
var video = this.image;
if ( video.readyState >= video.HAVE_CURRENT_DATA && video.currentTime > 0 && !video.paused && !video.ended) {
this.needsUpdate = true;
}
}
} );
Version of three.js used: 0.113.2
I'd be happy if it could help!
The text was updated successfully, but these errors were encountered:
Hi there,
I was using multiple
VideoTexture
for a project and I realize that even if all the videos were paused, I was getting a huge drops of fps.So I did a little bit of research and I've seen that all the textures are updated with the
this.needsUpdate = true;
at every frames, which shouldn't be required since the videos were paused and nothing needed to be updated in my case.I've overriden the
VideoTexture.update()
method by adding a condition to prevent calls if the video is paused and the fps increased to 60.Maybe it would be nice to add an option to not call the "needsUpdate = true" if the video is paused which seems to add a lot of calculations. Something like :
Version of three.js used: 0.113.2
I'd be happy if it could help!
The text was updated successfully, but these errors were encountered: