pmndrs / gltfjsx

🎮 Turns GLTFs into JSX components
https://gltf.pmnd.rs
MIT License
4.41k stars 290 forks source link

Wrong UV values #236

Open MathisEngels opened 7 months ago

MathisEngels commented 7 months ago

Hi.

When I use gltfjsx, the UV of an object gets replaced with wrong values. For example : Original.glb file : image

As you can see on the above picture, Table as UV and the first 3 are : 0.4732959568500519, 0.8645936250686646, 0.2926514446735382

Now I run npx gltfjsx@6.2.13 .\scene1-rigid.glb -T -f png -k -j on the file. This is what I get : image

UV for "Table001" are changing for 0.0625 (for the 152 values). 0.0625 never appear in the original UV array.

Note: If you wonder why instanceUVs and instanceNames arrays goes from 30 to 10 in size, it's because there is instancedMeshes.

TLDR : UV array after using gltfjsx gets changed to an array filled with a random value.

Files : scene1.zip

donmccurdy commented 5 months ago

Depending on the configuration of the optimization pipeline, glTF Transform may reorder vertices, eliminate some vertices, or change the numerical values of vertex attributes. The intention of the optimizations is that the scene should look the same, while being represented in a more compact way. If the model does not look visually the same, that could be a bug we could investigate. If you require that no vertex data change in any way, then little optimization is possible, and you probably need to skip the -T flag.