I’ve invested several days time to learn and build blender scripts to convert *.obj files to *.glb because we will be passing them around online for use by three.js applications and want to minimize bandwidth usage. The obvious assumption is that the glb format would be more compact.
However, one of the first files I’ve used for testing grows larger when converted to .glb (25,146,576 bytes), and even larger as gltf (33,529,922 bytes). The original obj is 11,055,741 bytes; it contains 149,677 vertices and 299,350 faces. That’s it; no animations or materials, just a mesh. And the mesh is all I need to store in the file because we just color and light it later.
In blender, I clear everything with
bpy.ops.wm.read_factory_settings(use_empty=True) to get rid of its camera, cube, lighting, etc. Then I import the object file and export as gltf or glb. The gltf file contains a single scene, but seems to have created a material, and has 3 accessors into the buffer: 10,776,600 bytes of 898,050 VEC3s, another 10,776,600 bytes of 898,050 VEC3s, and 3,592,200 bytes of SCALARs.
Is there anything I can do to reduce this bloat? It would be much more efficient for me to stick with .OBJ files, which is counter-intuitive since everything I read makes me believe gltf was designed for this purpose.
Thanks for any insights.