I have a simple Three.js scene with only one cube. The cube has multiple materials and I am trying to send this cube to a backend. To do so I think the best approach would be to export the cube into GLTF or GLB format using GLTFExporter, download the .gltf or .glb file and then send it to the backend.
My main issue is that I am unable to convert the cube into a GLTF or GLB format properly. The materials are not staying intact. If the 6 faces of the cube have 6 different materials, then after exporting the .gltf file or .glb file has 6 faces of the cube with only one material applied on all the faces.
How do I resolve this issue?
This issue is also reported in the official GitHub repository. Here is the link to the issue - GLTFExporter does not honor groups with non-indexed geometry. · Issue #21538 · mrdoob/three.js · GitHub