---
id: "gltf-2-0"
title: "glTF 2.0 asset format"
aliases: [glTF, GLB, gltf2]
domain: "performance"
stage: "performance"
realtime: "realtime"
platforms: [webgl2, webgpu, desktop-gpu, mobile-gpu, unity, unreal, godot, blender, python]
year_introduced: 2017
inputs: [mesh, texture, material-params, skeleton, animation]
outputs: [mesh, texture, material-params, animation]
style: "both"
dynamic: "both"
cost: "cheap"
authority: "Group"
url: "https://texelatlas.vercel.app/t/gltf-2-0/"
sources_verified_at: "2026-11-29"
---
# glTF 2.0 asset format (Group)

> A JSON-plus-binary scene format with a metallic-roughness PBR material model and extensions, designed to be uploaded to the GPU with minimal processing.

## Reach for it when

- need one format to move 3d assets to the web
- exported model looks different in each viewer
- reduce download size of a 3d model
- pbr material interchange between blender and three.js
- load animated skinned characters in a browser

## How it works

A glTF asset is a JSON description of a scene graph (nodes, meshes, skins, cameras, animations) that points at binary buffers and image files. Buffers are organized as bufferViews and typed accessors that match GPU vertex attribute layouts, so data can often be copied to vertex buffers as is. The GLB container packs JSON and buffers into one file.

Materials use a metallic-roughness model (base color, metallic, roughness, normal, occlusion, emissive), so a viewer needs only one shader family. Everything beyond that core is optional, named extensions: KHR_materials_* for clearcoat, transmission, sheen, anisotropy and others, KHR_draco_mesh_compression and EXT_meshopt_compression for geometry, KHR_texture_basisu for KTX2 textures.

Animation is stored as keyframe samplers targeting node transforms or morph weights; skinning uses joints and weights per vertex.

## When to use it

Choose it as the runtime and web interchange format between DCC tools, three.js, Babylon, engines and viewers. Prefer USD or FBX for authoring pipelines needing layering, variants or complex rigs, and [MaterialX](https://texelatlas.vercel.app/t/materialx.md) or [OpenPBR Surface](https://texelatlas.vercel.app/t/openpbr-surface.md) where full authoring-time material graphs are needed. Add [meshoptimizer mesh optimization](https://texelatlas.vercel.app/t/meshoptimizer.md) or [Draco mesh compression](https://texelatlas.vercel.app/t/draco-mesh-compression.md) and [Basis Universal / KTX2 supercompression](https://texelatlas.vercel.app/t/basis-universal-ktx2.md) to shrink delivery size.

## Cost

cheap — Load cost is mostly decoding compressed buffers and textures; the format itself adds little overhead.
Measured GPU Weight: 4.23× baseline (light) — 0.1393 ms median / 0.1433 ms p95 on Tesla T4/PCIe/SSE2 @ 1920x1080 (opengl-timer-query).
Ada L4 scaling: 3.26× baseline (light) — 0.0519 ms median (2.68× faster on L4).
Ampere A100 scaling: 3× baseline (light) — 0.0863 ms median (1.61× faster on A100).

## Failure modes

- Core material model cannot express layered or measured BRDFs, so extensions are required and viewer support varies
- Different exporters disagree on units, axis conventions and sRGB vs linear texture tagging, causing mis-scaled or washed-out assets
- Compressed-geometry or Basis extensions fail silently in viewers that lack decoders
- Vertex colors, KHR_materials_emissive_strength or unlit materials are interpreted differently across renderers
- Large scenes in a single JSON file load slowly; there is no built-in streaming or LOD

## Engine support

- babylonjs: official — `import "@babylonjs/loaders/glTF"` (evidence: https://github.com/BabylonJS/Babylon.js/blob/9.38.0/packages/dev/loaders/src/glTF/2.0/glTFLoader.pure.ts, checked 2026-12-01)
- blender: official — `File > Import/Export > glTF 2.0 (.glb/.gltf)` (evidence: https://docs.blender.org/manual/en/5.2/addons/scene_gltf2.html, checked 2026-12-01) — Official Blender-maintained add-on.
- godot: builtin — `Import .gltf/.glb as a scene; GLTFDocument for runtime load and export` (evidence: https://github.com/godotengine/godot/blob/4.7.2-stable/modules/gltf/doc_classes/GLTFDocument.xml, checked 2026-12-01)
- threejs: official — `import { GLTFLoader } from 'three/addons/loaders/GLTFLoader.js'` (evidence: https://github.com/mrdoob/three.js/blob/r187/examples/jsm/loaders/GLTFLoader.js, checked 2026-12-01)
- unity: official — `Package Manager > Unity Registry > glTFast (com.unity.cloud.gltfast)` (evidence: https://docs.unity3d.com/Packages/com.unity.cloud.gltfast@6.0/manual/index.html, checked 2026-12-01) — Unity-published package; import and runtime load.
- unreal: official — `Import .gltf/.glb through Interchange (Import Into Level or Content Browser import)` (evidence: https://dev.epicgames.com/documentation/en-us/unreal-engine/interchange-import-reference-in-unreal-engine, checked 2026-12-01)

## Dataflow

- Inputs: mesh, texture, material-params, skeleton, animation
- Outputs: mesh, texture, material-params, animation
- Platforms: webgl2, webgpu, desktop-gpu, mobile-gpu, unity, unreal, godot, blender, python

## Presets

### glTF 2.0 PBR Asset Format — raw metallic-roughness + tangent normal channels (left) vs full Khronos PBR + KHR_materials_clearcoat render (right) (glsl-fragment; rendered 2026-11-30)

```json
{
  "P_METALLIC": 0.78,
  "P_ROUGHNESS": 0.28,
  "P_CLEARCOAT": 0.65,
  "P_SPLIT": 0.45
}
```

```glsl
const float P_METALLIC = 0.78; // P Metallic Factor [0.0, 1.0, 0.02]
const float P_ROUGHNESS = 0.28; // P Roughness Factor [0.08, 0.90, 0.02]
const float P_CLEARCOAT = 0.65; // P KHR Clearcoat [0.0, 1.0, 0.05]
const float P_SPLIT = 0.45; // P PBR Channels / Final [0.0, 1.0, 0.02]

vec2 rot2(vec2 p, float a) {
  float c = cos(a);
  float s = sin(a);
  return vec2(c * p.x - s * p.y, s * p.x + c * p.y);
}

float D_GGX(float ndh, float a) {
  float a2 = a * a;
  float d = ndh * ndh * (a2 - 1.0) + 1.0;
  return a2 / max(3.1415926 * d * d, 1e-5);
}

float G_Smith(float ndv, float ndl, float a) {
  float k = (a + 1.0) * (a + 1.0) * 0.125;
  float gv = ndv / max(ndv * (1.0 - k) + k, 1e-4);
  float gl = ndl / max(ndl * (1.0 - k) + k, 1e-4);
  return gv * gl;
}

vec3 F_Schlick(float cosT, vec3 f0) {
  return f0 + (1.0 - f0) * pow(clamp(1.0 - cosT, 0.0, 1.0), 5.0);
}

vec3 evalStudioIBL(vec3 r, float rough) {
  vec3 sky = mix(vec3(0.08, 0.10, 0.15), vec3(0.45, 0.56, 0.72), smoothstep(-0.25, 0.7, r.y));
  float panel1 = smoothstep(0.65 - rough * 0.25, 0.92, dot(r, normalize(vec3(0.6, 0.65, 0.45))));
  float panel2 = smoothstep(0.60 - rough * 0.25, 0.90, dot(r, normalize(vec3(-0.75, 0.35, 0.55))));
  float horizon = exp(-abs(r.y) * mix(16.0, 3.0, rough)) * 0.45;
  return sky + vec3(2.2, 1.95, 1.65) * panel1 + vec3(0.55, 0.85, 1.25) * panel2 + vec3(0.75, 0.82, 0.92) * horizon;
}

vec3 aces(vec3 x) {
  x = max(x, 0.0);
  return (x * (2.51 * x + 0.03)) / (x * (2.43 * x + 0.59) + 0.14);
}

void mainImage(out vec4 fragColor, in vec2 fragCoord) {
  vec2 uv = (fragCoord - 0.5 * iResolution.xy) / iResolution.y;
  float screenX = fragCoord.x / max(iResolution.x, 1.0);
  float split = clamp(P_SPLIT, 0.0, 1.0);
  float metFactor = clamp(P_METALLIC, 0.0, 1.0);
  float rghFactor = clamp(P_ROUGHNESS, 0.06, 0.95);
  float coatFactor = clamp(P_CLEARCOAT, 0.0, 1.0);

  vec3 ro = vec3(0.0, 0.25, 2.35);
  vec3 rd = normalize(vec3(uv.x, uv.y - 0.06, -1.52));
  vec3 col = evalStudioIBL(rd, 0.55) * 0.35;

  // Classic glTF 2.0 Khronos DamagedHelmet-inspired center hero sphere + flanking dielectric/metal reference spheres
  vec3 pos[3];
  float rad[3];
  pos[0] = vec3(0.0, 0.04, 0.05); rad[0] = 0.44;
  pos[1] = vec3(-0.68, -0.14, -0.12); rad[1] = 0.24;
  pos[2] = vec3(0.68, -0.14, -0.12); rad[2] = 0.24;

  float tMin = 1e5;
  int hitId = -1;
  vec3 hp = vec3(0.0);
  vec3 hn = vec3(0.0, 1.0, 0.0);

  if (rd.y < -0.005) {
    float tf = (-0.42 - ro.y) / rd.y;
    if (tf > 0.05 && tf < 14.0) {
      tMin = tf; hitId = 10; hp = ro + rd * tf; hn = vec3(0.0, 1.0, 0.0);
    }
  }
  for (int i = 0; i < 3; i++) {
    vec3 oc = ro - pos[i];
    float b = dot(oc, rd);
    float d = b * b - (dot(oc, oc) - rad[i] * rad[i]);
    if (d > 0.0) {
      float ts = -b - sqrt(d);
      if (ts > 0.05 && ts < tMin) {
        tMin = ts; hitId = i; hp = ro + rd * ts; hn = normalize(hp - pos[i]);
      }
    }
  }

  if (hitId >= 0) {
    vec3 v = -rd;
    vec3 n = hn;
    vec3 baseColor = vec3(0.75);
    float metallic = metFactor;
    float roughness = rghFactor;
    vec3 emissive = vec3(0.0);

    if (hitId == 10) {
      vec2 g = hp.xz * 2.4;
      float chk = mod(floor(g.x) + floor(g.y), 2.0);
      baseColor = mix(vec3(0.16, 0.18, 0.22), vec3(0.32, 0.35, 0.40), chk);
      metallic = 0.10;
      roughness = 0.42;
    } else if (hitId == 0) {
      vec3 lp = hn;
      lp.xz = rot2(lp.xz, iTime * 0.45);
      // Procedural panel seams & emissive visor band (classic glTF 2.0 packed textures)
      float panel = smoothstep(0.03, 0.09, abs(sin(lp.x * 12.0)) * abs(sin(lp.y * 10.0)));
      float visor = smoothstep(0.18, 0.06, abs(lp.y - 0.08)) * smoothstep(-0.1, 0.35, lp.z);
      baseColor = mix(vec3(0.14, 0.16, 0.20), vec3(0.88, 0.66, 0.30), panel);
      baseColor = mix(baseColor, vec3(0.06, 0.09, 0.14), visor);
      metallic = mix(0.25, metFactor, panel);
      roughness = mix(0.55, rghFactor, panel);
      // Micro normal perturbation along panel seams
      n = normalize(hn + vec3(cos(lp.x * 12.0), cos(lp.y * 10.0), 0.0) * 0.09 * (1.0 - panel));
      emissive = vec3(0.18, 0.92, 1.0) * smoothstep(0.05, 0.015, abs(lp.y - 0.08)) * smoothstep(0.0, 0.35, lp.z) * 1.4;
    } else if (hitId == 1) {
      baseColor = vec3(0.88, 0.24, 0.20);
      metallic = 0.04;
      roughness = 0.22;
    } else {
      baseColor = vec3(0.92, 0.78, 0.48);
      metallic = 0.96;
      roughness = 0.18;
    }

    if (screenX < split) {
      // Left: glTF 2.0 packed buffer attribute breakdown (top half = normal map, bottom half = R:AO G:Roughness B:Metallic!)
      if (uv.y > 0.02) {
        col = n * 0.5 + 0.5;
      } else {
        float ao = (hitId == 10) ? smoothstep(0.18, 0.65, length(hp.xz)) : (0.5 + 0.5 * n.y);
        col = vec3(ao, roughness, metallic);
      }
    } else {
      // Right: Spec-compliant glTF 2.0 metallic-roughness BRDF + KHR_materials_clearcoat + emissive
      vec3 l = normalize(vec3(0.62 * cos(iTime * 0.35), 0.75, 0.55));
      vec3 h = normalize(l + v);
      float ndl = max(dot(n, l), 0.0);
      float ndv = max(dot(n, v), 0.001);
      float ndh = max(dot(n, h), 0.0);
      float vdh = max(dot(v, h), 0.0);

      vec3 f0 = mix(vec3(0.04), baseColor, metallic);
      float a = roughness * roughness;
      vec3 F = F_Schlick(vdh, f0);
      float D = D_GGX(ndh, a);
      float G = G_Smith(ndv, ndl, roughness);
      vec3 specDir = (D * G * F) / max(4.0 * ndv * ndl, 0.001);
      vec3 kD = (1.0 - F) * (1.0 - metallic);
      vec3 direct = (kD * baseColor / 3.1415926 + specDir) * vec3(2.4, 2.25, 2.0) * ndl;

      vec3 r = reflect(-v, n);
      vec3 envSpec = evalStudioIBL(r, roughness) * F_Schlick(ndv, f0);
      vec3 envDiff = evalStudioIBL(n, 0.9) * baseColor * (1.0 - metallic) * 0.35;

      // KHR_materials_clearcoat secondary specular lobe (IOR 1.5 -> F0 = 0.04, low roughness)
      float coatA = 0.06 * 0.06;
      float coatD = D_GGX(ndh, coatA);
      float coatF = 0.04 + 0.96 * pow(1.0 - ndv, 5.0);
      vec3 coatSpec = (vec3(coatD * 0.25 * ndl) + evalStudioIBL(r, 0.06) * coatF) * coatFactor * (hitId == 10 ? 0.1 : 0.85);

      col = direct + envDiff + envSpec + coatSpec + emissive;
      if (hitId == 10) col = mix(evalStudioIBL(rd, 0.55) * 0.35, col, exp(-tMin * 0.14));
    }
  }

  float sep = smoothstep(0.0035, 0.0008, abs(screenX - split));
  col = mix(col, vec3(0.95, 0.98, 1.0), sep);
  fragColor = vec4(pow(clamp(aces(col), 0.0, 1.0), vec3(1.0 / 2.2)), 1.0);
}
```

Attribution: MIT — written for this index.

## Combines with

- [meshoptimizer mesh optimization](https://texelatlas.vercel.app/t/meshoptimizer.md): glTF's EXT_meshopt_compression stores buffers in meshoptimizer's encoded form for smaller downloads.
- [Basis Universal / KTX2 supercompression](https://texelatlas.vercel.app/t/basis-universal-ktx2.md): KHR_texture_basisu lets glTF reference KTX2 textures that transcode to the GPU's native block format.

## Sources

1. [primary] The Khronos® 3D Formats Working Group glTF 2.0 Specification. registry.khronos.org. https://registry.khronos.org/glTF/specs/2.0/glTF-2.0.html (verified via http on 2026-11-29)
2. [implementation] KhronosGroup (2017) KhronosGroup/glTF-Sample-Viewer. https://github.com/KhronosGroup/glTF-Sample-Viewer License: Apache-2.0. (verified via github on 2026-11-29)
3. [implementation] donmccurdy (2018) donmccurdy/glTF-Transform. https://github.com/donmccurdy/glTF-Transform License: MIT. (verified via github on 2026-11-29)
4. [secondary] KhronosGroup (2013) KhronosGroup/glTF. https://github.com/KhronosGroup/glTF License: NOASSERTION. (verified via github on 2026-11-29)

## Cite this entry

Texel. "glTF 2.0 asset format." https://texelatlas.vercel.app/t/gltf-2-0/ (accessed 2026-12-01).
