hi. you can create two materials, clone the mesh and animate the transparency of the materials thereby obtaining a smooth transition or blending materials in the shader, but at the moment there is no implementation of the pbr material in the shader node editor. let’s call a shader specialist)))
I don’t think that you need to create new materials. New texture is enough for this purpose.
Blinking at your example may have 2 reasons:
Texture is not yet loaded when switching - so make sure it is fully loaded before switching (for example, with Asset Manager).
You dispose texture, then apply new one. Try to do vise versa - first apply new one, then dispose old (if it is really needed; I don’t see any sense in it since user can click on other button and you will need to wait till disposed texture will load again…)
You may be interested to have a look at my demo Mu-so 2nd Generation 3D or more extended testing prototype Mu-so 2nd Generation 3D (there could be some short blink when you change texture for the first time but the model itself stays as it is).
Replace them before you dispose the old ones, with the way you have it written there would be a 2ms gap minimum (if both lines only take 1ms) where the textures are blank.
I found that material.isReady() will be false at the first call and true after that.
/// ... creating material
material = ...
console.info("material status 1: " + material.isReady()); // false
console.info("material status 2: " + material.isReady()); // true
Is it proper logic to always call isReady() after creating a material, so that it can be used at runtime later (e.g. a mesh switch to use several materials that are created before ahead)?