How to animate the texture map change of MeshBasicMaterial using gsap ? (or any other possible method)

Hi, I was able to successfully animate the color attribute of the material when the raycast hit my object (am creating a hover effect) using gsap but now am stuck on the map attribute, it’s changing as expected (object.material.map = newMap;) but that isn’t smooth it just replace it, how can I make that replacement smoother?

Hi!
For some ideas, have a look at this post: Smooth transition between textures with GSAP - #6 by prisoner849

thanks for the reply, is there any way to do it without switching to shadermaterial ?

You can modify shaders of existing materials, using .onBeforeCompile().
AFAIK, there is no out-of-box functionality for transition between textures.

okay switching to ShaderMaterial seems to be my best solution, thanks a lot it was an honor to get a reply from you, I always find the best solutions from your previous answers :smiley:

Been asked for several times already with the same question. So, here is an option with tween.js and modified MeshLambertMaterial: Texture transition - JSFiddle - Code Playground

Not the ultimate solution, but a starting point.

TextureTransition

2 Likes

Running on the latest three.js reports an error