File and loading differences for glb vs gltf

Pardon my ignorance but why does glb have fewer network requests compared to a gltf? When I export from Blender and use gltf loader for either formats, I only ever export/load 1 file because the blender gltf exporter only exports the 1 file regardless of whether it’s a glb or a gltf. I did apply the texture onto the model in Blender so that might be the case?

2 Likes

The newest version of the Blender exporter has three export options, from most-to-least efficient:

  • Binary (.glb)
    • One file, one network request, and binary payload.
  • Separate (.gltf, .bin, + textures)
    • Multiple files, multiple network requests, and binary payload.
  • Embedded (.gltf)
    • One file, one network request, and Data URI payload (adds 20-30% to filesize)

There are special cases where separating assets can be a good idea (e.g. if multiple models share the same texture). But in general, the binary (GLB) form is most efficient. There is no advantage to a single embedded .gltf file I’m aware of, except that it’s easy to edit by hand.

Note that all of the formats contain a JSON header, but this is limited to defining structure and materials — the heavy vertex, animation, and texture data is not JSON.

10 Likes

Ahhh, it all makes sense now. I’ve read – many times-- that glb has everything packed together as well but I couldn’t see the point of having both formats. But now I know…

1 Like