donmccurdy / glTF-Transform

glTF 2.0 SDK for JavaScript and TypeScript, on Web and Node.js.
https://gltf-transform.dev
MIT License
1.3k stars 145 forks source link

Quantization creates invalid skinning weights for CesiumMan.glb #1404

Closed donmccurdy closed 1 week ago

donmccurdy commented 1 month ago

Quantizing CesiumMan with gltf-transform quantize CesiumMan.glb CesiumMan+quant.glb we see validation errors and visible 'spikes' in the geometry. Problem appears related to sorting and normalizing the skinning weights. Tested in v4-alpha.

CesiumMan.glb.zip

https://github.com/donmccurdy/glTF-Transform/blob/13fbccffa50f9d0ab0f9b68413817a9cd6f37191/packages/functions/src/sort-primitive-weights.ts#L74-L75

Related:

marwie commented 1 week ago

Just saw this issue appear in one of our meshes here as well - draco doesn't have this issue but in this case meshopt is much preferred due to blendshape compression 😊

donmccurdy commented 1 week ago

In progress:

marwie commented 1 week ago

Thanks a lot for the superfast fix!