Viewing gltf models with dynamically changed materials in AR

  1. I have a GLTF model of a chair with material Fabric_1 applied on it.
  2. I have created a system where the user can change the material Fabric_2, Fabric_3 and Fabric_4 using texture loader in runtime on the chair.
  3. I have coded in webXR so that i can view my gltf model (chair) in AR
  4. how do I code so that when my user has changed the material on the chair, its reflected on the model viewed in AR in runntime?

its the same code and routine in desktop mode as it is in ar, just keep references to the subject object and change its material and .map texture settings