Issue with Exporting Colored Mesh to USDZ Format on R3F

Sahaj_singh
Mon, 18 Mar 2024 08:50:39 +0000
Questions

I’m working on a project where I’m rendering a 3D mesh with vertex colors using Three.js and React. The mesh is displayed correctly with colors in my application. However, when I export this mesh to the USDZ format using the USDZExporter from Three.js, the resulting USDZ model appears without any colors when viewed in an external USDZ viewer (e.g., https://www.usdz-viewer.net/).

Here’s a visual representation of the issue:

Colored mesh rendered correctly in my application

I’m following the recommended steps to set up vertex colors, normals, and proper lighting in my Three.js scene:

Using THREE.MeshStandardMaterial with vertexColors: true and blending: THREE.NormalBlending.
Adding an ambient light to the scene for proper illumination.
Computing and setting vertex normals for the geometry.

This is the code for the download USDZ function

And this is the Material using the color from the geometry

I tried to use GLTF Exporter and it works pretty well (showing the colors) but not with exported USDZ mesh appear colorless.
Why would that be a case?

7 posts - 4 participants