zeux / meshoptimizer

Mesh optimization library that makes meshes smaller and faster to render
MIT License
5.6k stars 480 forks source link

gltfpack: Attach meshes directly to nodes when quantization is a no-op #700

Closed zeux closed 4 months ago

zeux commented 4 months ago

If the input model is already quantized with the same settings wrt position encoding, then the computed quantization parameters result in a no-op transform (offset 0, scale 1). However, repeat invocations of gltfpack will each add one extra node with a no-op transform. With this change, if we can afford to attach the mesh directly we will do so.

Note that in the future, we could also merge node transforms via the hierarchy, but that should be a separate optional optimization as it can interfere with application processing logic.