# Ghosting using animated Gifs

**URL:** https://forum.babylonjs.com/t/ghosting-using-animated-gifs/57146
**Category:** Questions
**Created:** [March 15, 2025, 12:01pm UTC](https://forum.babylonjs.com/t/ghosting-using-animated-gifs/57146 "2025-03-15T12:01:44Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![gorenje](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/gorenje/32/18894_2.png) [@gorenje](https://forum.babylonjs.com/u/gorenje)
#### Post date: [March 15, 2025, 12:01pm UTC](https://forum.babylonjs.com/t/ghosting-using-animated-gifs/57146/1 "2025-03-15T12:01:44Z")

</div>

Hi There,

I’ve been playing around with implementing animated gifs in my scene. I was looking for a texture and came across this [previous discussion](https://forum.babylonjs.com/t/animated-gifs-in-babylon/9707) and the corresponding [PG](https://playground.babylonjs.com/#ZDVUR3#5) using ImageDecoder API to splice animated gifs into single frames.

Trying this out with my [gif](https://cdn.openmindmap.org/content/1729438029678_fh-retrieve-via-flowhub-nodes.gif), I came across a strange affect and wanted to know what I could do. My example [gif](https://cdn.openmindmap.org/content/1729438029678_fh-retrieve-via-flowhub-nodes.gif) works perfectly in any browser and in it’s original context. But when I put it into my scene, I get this “ghosting” affect (demonstrated by this [PG](https://playground.babylonjs.com/#ZDVUR3#14)):

![ghosting](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/3X/0/0/009253d9a32cee1c5d0b4b9853530bcd88b9c271.gif)

I played around with the original code and got rid the ghosting affect by moving the camera towards the mesh - demonstrated by this [PG](https://playground.babylonjs.com/#ZDVUR3#13).

So it would appear that if I move the camera away from the texture (I.e. mesh) the ghosting of the gif begins.

I don’t know my way around the various textures - I have no idea why the code uses the `albedoTexture` texture. Could that be an issue in this case?

For my use case, moving the camera towards the mesh isn’t a solution 😉

Any tips? Thanks in advance!

EDIT: I get this affect with my Opera browser and the Quest3 browser using WebXR. I haven’t tested any other platform.

---

<div class="post-metadata">

### Author: ![samuelgirardin](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/samuelgirardin/32/87_2.png) [@samuelgirardin](https://forum.babylonjs.com/u/samuelgirardin)
#### Post date: [March 16, 2025, 7:03pm UTC](https://forum.babylonjs.com/t/ghosting-using-animated-gifs/57146/2 "2025-03-16T19:03:38Z")

</div>

Hi, I suppose it’s related to the texture sampling mode. Using _Texture.NEAREST\_LINEAR_ seems to solve the ghost effect : [https://playground.babylonjs.com/#ZDVUR3#18](https://playground.babylonjs.com/#ZDVUR3#18)

---

<div class="post-metadata">

### Author: ![gorenje](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/gorenje/32/18894_2.png) [@gorenje](https://forum.babylonjs.com/u/gorenje)
#### Post date: [March 16, 2025, 7:49pm UTC](https://forum.babylonjs.com/t/ghosting-using-animated-gifs/57146/3 "2025-03-16T19:49:14Z")

</div>

Thank you, that indeed fixed it! 🙂 Sweet!
