Ghosting using animated Gifs

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 and the corresponding PG using ImageDecoder API to splice animated gifs into single frames.

Trying this out with my gif, I came across a strange affect and wanted to know what I could do. My example 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):

ghosting

I played around with the original code and got rid the ghosting affect by moving the camera towards the mesh - demonstrated by this PG.

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 :wink:

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.

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

1 Like

Thank you, that indeed fixed it! :slight_smile: Sweet!