Open JuanFdS opened 3 years ago
Hi! @shawnlawson , how are you?
I'm working on a possible implementation for this. I have 2 ideas of how it could be done:
paint()
calculate the correct image to display and update it with texImage2D(...)
.texImage2D
supports video elements.I'm already working on the first one locally and after hardcoding a lot of stuff (I already have the frames + know their duration + changed the code in the nyan cat texture to load this instead) was able to get something working
However, in order to get any of the 2 options done I think we'd need to add a dependency to split the gif into frames or turn it into a video. And I think I'll need some help understanding how to add that to this project :P
For example, let's say I wanted to add this dependency to split the gif into frames: https://github.com/matt-way/gifuct-js how should I do it? 🤔
Oh, I see, hmmm. I suppose if the dependency can be built into an include-able file that would work. I can work on that, but not for a couple weeks. Looks pretty awesome though!
putting these here so I don't forget them. https://github.com/movableink/three-gif-loader https://github.com/MaciejWWojcik/three-plain-animator
Right now gifs can be uploaded as textures.
However, they aren't animated and instead get frozen at some frame, it'd be nice to have them animated.