donmccurdy / glTF-Transform

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

Quantization creates invalid skinning weights for CesiumMan.glb #1404

Closed donmccurdy closed 4 months ago

donmccurdy commented 6 months 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 4 months 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 4 months ago

In progress:

marwie commented 4 months ago

Thanks a lot for the superfast fix!