[SOLVED] Textures Modifying Issue

Greetings!

In order to do optimization, I made my textures(diffuse map) null when I don’t need them, as you can see in the code below.

And it does this successfully because I can see that the textures are removed from my model also I can see that in the console, diffuseMap is now Null.

Now to the part where I am having issues, when I try to reassign the same texture to the model, then on the console. It shows that the textures are applied but on the model, textures are not applied. As you can see in the screenshot below

This is the part of the code where I m applying the code.

If anyone can help, That would be great :slight_smile:

So, you are basically changing textures at runtime. It’s not just assigning it to the material, but updating the shaders behind it.

Did you see this example?

Another thing that may be happening is that if you make a texture null, the shader itself, when built, is optimized by not adding the corresponding chunk. I would first try the first idea though.

2 Likes

Thanks for the info, i did a silly mistake(forgot to do .update()). It’s working now.