What Is the Relation Between .gltf and .bin Files?

The relationship between a .gltf file and its companion .bin file is a division of labor between scene structure and raw geometric payload. A .gltf file contains a human-readable JSON schema defining the scene hierarchy, materials, node transformations, animations, and object relationships. In contrast, the external .bin file stores the raw, unformatted binary data—including vertex positions, normals, texture coordinates, bone weights, and animation keyframes—which the JSON references through byte offsets and buffer views.

The Dual-File Architecture of glTF

The GL Transmission Format (glTF) was designed by the Khronos Group to serve as the "JPEG of 3D." Its primary design requirement is rapid loading and GPU parsing across web and real-time graphics engines.

Representing high-density 3D coordinates, index arrays, and float values directly in JSON text creates significant parsing overhead and balloons file sizes. To solve this, glTF separates structured metadata from heavy numerical arrays:

How the JSON Manifest Addresses the Binary Payload

The connection between the text-based .gltf document and the .bin asset is established via a three-tier indexing system defined within the JSON: Buffers, BufferViews, and Accessors.

1. Buffers (buffers)

The buffers array defines the physical storage location and total byte length of the binary resource. For a separate binary file, the JSON entry references the URI directly:

"buffers": [
  {
    "uri": "model_data.bin",
    "byteLength": 102400
  }
]

2. BufferViews (bufferViews)

A bufferView slices the monolithic binary chunk into discrete continuous partitions. It tells the runtime engine how to isolate specific regions of memory, defining a starting byte offset (byteOffset), total segment length (byteLength), and optional stride (byteStride) for interleaved attribute arrays:

"bufferViews": [
  {
    "buffer": 0,
    "byteOffset": 0,
    "byteLength": 38400,
    "target": 34962
  }
]

The target parameter communicates whether the data should bind as a vertex attribute buffer (ARRAY_BUFFER) or an index buffer (ELEMENT_ARRAY_BUFFER).

3. Accessors (accessors)

An accessor sits on top of a bufferView and defines how the underlying raw bytes must be typed and read by rendering APIs such as WebGL, WebGPU, Vulkan, or DirectX. It provides:

Meshes, primitives, and animation channels reference accessor indices rather than the binary data directly.

Operational Lifecycle During Scene Loading

When a runtime engine loads a .gltf asset with an external .bin component, the loading pipeline operates through sequential phases:

  1. Manifest Retrieval: The engine fetches and parses the .gltf JSON structure.
  2. Binary Fetching: The engine resolves the uri in the buffers section and asynchronously fetches the .bin file as an ArrayBuffer.
  3. Direct Memory Mapping: Rather than iterating over strings to reconstruct arrays, the runtime maps the binary buffer directly into GPU memory buffers (VBOs and IBOs) according to the specifications in bufferViews.
  4. Scene Graph Construction: Materials, textures, node hierarchies, and skinning rigs from the JSON are bound to the GPU-resident buffers via their assigned accessors.

Advantages of Separating the Files

Keeping the JSON manifest and binary payload in discrete files provides specific production advantages: