Tricks to Decrease Morph Target Sizes?

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:

  1. Open .FBX in Blender, and give materials a 4x4 dummy image for the normal map if they don’t have one.
  2. Export as .FBX (instead of .GLB because FBX2GLTF has better compression)
  3. Convert to .GLB with FBX2GLTF.
  4. Compress with gltfpack using -noq and -cc. (I experimented with -si to simplify meshes, but slight defects were not compatible with my use-case)
1 Like