Update #2 - This is what I eventually did:
After much pain and suffering I got meshopt compression working on a GLB model that uses morphs.
With gltfpack
you have to use -noq
(no quantization) since PlayCanvas doesn’t support that yet. That option is documented in the -h
help CLI output, but is missing from the gltfpack README, which tripped me up.
Having the PlayCanvas viewer for reference (which implements meshopt) helped a lot. Morphs out of the box seem to work perfectly fine, but I did have a weird issue where model materials that did not have an image set on the normal map (before sending it through gltfpack), would not show a diffuse texture in PlayCanvas. I haven’t yet figured out if that’s an issue with my PlayCanvas code, how the model is built in Maya, PlayCanvas’ implementation, or Meshopt’s implementation. All I know is sending it through gltfpack
without any compression (no -c
) or quantization (-noq
) would break the diffuse textures and not sending it through gltfpack
at all would work fine. Currently, seeing a 2.5x reduction in model size, which I’m thrilled with. (The model is now ~110 KB from 275 KB, but 80 KB - 90 KB looks possible)
Because of the odd texture issue I’ve found this workflow works best for me converting FBX files:
- Open .FBX in Blender, and give materials a 4x4 dummy image for the normal map if they don’t have one.
- Export as .FBX (instead of .GLB because FBX2GLTF has better compression)
- Convert to .GLB with FBX2GLTF.
- Compress with gltfpack using
-noq
and-cc
. (I experimented with-si
to simplify meshes, but slight defects were not compatible with my use-case)