Minimize the size of glb file exported from GLTFExporter

Hi
I have an fbx file which after using FBXLoader.parse I converted the resultant Object/Group using GLTFExporter to a glb file.
Now there is a huge difference between the size of these two files
The size of fbx file is around 40MB and the size of glb is more than three times the size of fbx which is 144MB.

Is there any way I can decrease the size of glb file?

Here is the piece of code that I am using to convert the file:-

const loader = new FBXLoader()
const object: any = loader.parse(response.target.result,
// An array buffer of fbx file got from reader.readAsArrayBuffer(fbxFile)
'')
const exporter = new GLTFExporter();
exporter.parse(object, (gltf: any) => {
    this.saveArrayBuffer(gltf, this.fileName.replace('.fbx', '.glb'));
}, {
 binary: true,
// embedImages: false
});

You’ll need to share the model to get help on this one, I think. It’s hard to guess what part of the model has been changed in the FBX -> three.js -> glTF process. You may also want to try converting with FBX2GLTF or with Blender.

1 Like

@donmccurdy Well It can be any fbx model, For instance here is the link of fbx model:-

After FBX -> three.js -> glTF process, Here is the glb file:-

Fbx model is less than 4MB but glb is 23.6MB (approx 6 times)

I’d recommend filing a bug on three.js — either FBXLoader or GLTFExporter is increasing the vertex count by quite a lot, basically de-indexing the mesh, and there could be good reasons for it but I’m not sure why. Both FBX2GLTF and Blender do a better job of converting the model, it looks like. It’ll still be a bit bigger initially, but then you can compress it to just 700kb with glTF-Pipeline:

iphone_draco.glb (743.3 KB)