I've successfully loaded an OBJ object with a material file (MTL) to a scene, which is working perfectly. The MTL file is linked to a JPG texture for the object, which I dynamically modify at runtime.
Now, my goal is to update the object with the new material (modified JPG) without having to remove and add the entire object to the scene, as this could impact performance.
Is there a method to simply re-render the object with the updated texture or re-attach the modified MTL?
mtlLoader.load("material.mtl", function (materials) {
materials.preload();
objLoader.setMaterials(materials);
objLoader.setPath("static/models/");
objLoader.load("object.obj", function (object) {
scene.add(object);
});