Animated GIF Texture

With the latest ImageDecoder API it is possible to decode gif image to frames without external deps.
The sample2DArray can hold at least 256 frames per spec, and up to 2048 frames on some modern computer, that far from enough for videos, but fairly enough for gif images. (Modern AI said a typical gif contains less than 100 frames)
Note that this is just a demo, so frame count is fixed in shader and frame delay is also not considered.

Engine: WebGL2
Version: 8.3.1

Another Image:

And a longer one:

3 Likes
3 Likes

Let’s update it a bit to use all frames

1 Like

Here is how we used it in the past :slight_smile: https://playground.babylonjs.com/#ZDVUR3#20