GIF as animated texture?

Hello all,
I’m trying to find a way to use a GIF as an animated texture for geometry. I’ve come across a couple of threads (like this one) that discuss this, but I’m not able to find a conclusive solution. I have found this example which does achieve something like this, but it doesn’t use a GIF, but rather a png that contains all frames of the animation, side by side.

I’m not sure if these discussions are outdated?
Might anyone have thoughts on the most up-to-date way of getting an animated texture on geometry?

thank you,
ali

1 Like

Using an animated gif directly as a source is not possible. Try the approach that is described in this thread: Using an animated gif as a displacement map - shaders

An alternative is the mentioned approach with a single (PNG) image that contains all frames of the animation.

More information about this topic here: http://www.html5gamedevs.com/topic/10299-animated-gif-image-as-texture-how-i-can-use-it/

1 Like

Thank you @Mugen87

That thread contains a couple of possible solutions.
Did you mean to suggest the technique used in this:
http://www.desolidstate.com/gif-canv-txtr.html

?

Basically yes, but this example uses the gif file also as an displacement map. You might need just a diffuse map.

1 Like

Another possibility is to convert the gif to a video and use a VideoTexture.

Gifs have very bad compression ratio and many image hosting sites automatically convert them to video these days. For example this one - if you try to save it you’ll see it’s actually an .mp4 file. So you can convert your gif texture by uploading it to one of these sites.

1 Like