---
id: "draco-mesh-compression"
title: "Draco mesh compression"
aliases: [Draco, KHR_draco_mesh_compression]
domain: "performance"
stage: "performance"
realtime: "realtime"
platforms: [webgl2, webgpu, cpu]
year_introduced: 2017
inputs: [mesh, point-cloud]
outputs: [mesh]
style: "both"
dynamic: "static"
cost: "medium"
authority: "google, 2016"
url: "https://texelatlas.vercel.app/t/draco-mesh-compression/"
sources_verified_at: "2026-11-29"
---
# Draco mesh compression (google, 2016)

> Google's open library that compresses mesh connectivity and quantized attributes into a small stream, decoded on the CPU at load time.

## Reach for it when

- mesh files are too big to download
- need smaller static models for the web
- point cloud transfer size is too large
- reduce geometry bandwidth with quantisation
- gltf models take too long to load over network

## How it works

Positions, normals and UVs are quantized to a chosen number of bits. Connectivity is encoded with an edgebreaker-style traversal, and attributes are predicted from already decoded neighbours, with the small residuals entropy coded. The decoder, often WebAssembly, rebuilds vertex and index arrays that go straight into GPU buffers.

The result is much smaller than uncompressed or gzip glTF, but decoding happens on load and the vertex order may change, so it is a delivery format and not a runtime format.

## When to use it

Choose it to cut download size of static meshes and point clouds. Prefer [meshoptimizer mesh optimization](https://texelatlas.vercel.app/t/meshoptimizer.md) encoding when fast decoding and vertex-cache order matter or when animation and morph targets are present. Prefer neither for tiny meshes where decoder size outweighs saved bytes.

## Cost

medium — Decoding cost sits on the CPU at load and grows with mesh size.
Measured GPU Weight: 15.8× baseline (moderate) — 0.5199 ms median / 0.5385 ms p95 on Tesla T4/PCIe/SSE2 @ 1920x1080 (opengl-timer-query).
Ada L4 scaling: 14.26× baseline (moderate) — 0.2267 ms median (2.29× faster on L4).
Ampere A100 scaling: 10.34× baseline (moderate) — 0.2978 ms median (1.75× faster on A100).

## Failure modes

- Quantization causes visible cracks between separately compressed meshes at seams
- Changed vertex order hurts cache efficiency unless reoptimized
- Decoding stalls the main thread without a worker
- Weak fit for animated or morph-target data

## Engine support

- babylonjs: builtin — `BABYLON.DracoCompression (used automatically by glTF KHR_draco_mesh_compression)` (evidence: https://github.com/BabylonJS/Babylon.js/blob/9.38.0/packages/dev/core/src/Meshes/Compression/dracoCompression.ts, checked 2026-12-01)
- blender: official — `Properties on export: File > Export > glTF 2.0 > Data > Compression (Draco)` (evidence: https://docs.blender.org/manual/en/5.2/addons/scene_gltf2.html, checked 2026-12-01) — Bundled glTF 2.0 add-on.
- threejs: official — `import { DRACOLoader } from 'three/addons/loaders/DRACOLoader.js'` (evidence: https://github.com/mrdoob/three.js/blob/r187/examples/jsm/loaders/DRACOLoader.js, checked 2026-12-01)
- unity: official — `Package Manager > Draco for Unity (com.unity.cloud.draco)` (evidence: https://docs.unity3d.com/Packages/com.unity.cloud.draco@5.0/manual/index.html, checked 2026-12-01) — Official Unity package.
- unreal: official — `Interchange glTF Importer (glTF 2.0 / GLB mesh import & decompression)` (evidence: https://dev.epicgames.com/documentation/en-us/unreal-engine/importing-gltf-files-into-unreal-engine, checked 2026-12-01)

## Dataflow

- Inputs: mesh, point-cloud
- Outputs: mesh
- Platforms: webgl2, webgpu, cpu

## Presets

### Draco Mesh Compression — low-bit quantized geometry & edgebreaker facets (left) vs 14-bit decoded smooth mesh (right) (glsl-fragment; rendered 2026-11-30)

```json
{
  "P_QUANT_BITS": 5,
  "P_WIRE_VIS": 0.55,
  "P_ROT_SPEED": 0.5,
  "P_SPLIT": 0.48
}
```

```glsl
const float P_QUANT_BITS = 5.00; // P Position Quant Bits [3.0, 9.0, 1.0]
const float P_WIRE_VIS = 0.55; // P Edgebreaker Mesh [0.0, 1.0, 0.05]
const float P_ROT_SPEED = 0.50; // P Turntable Speed [0.0, 1.6, 0.05]
const float P_SPLIT = 0.48; // P Low-Bit / Decoded [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);
}

// Sculpted organic torus-knot-like blob for exposing vertex quantization & normal oct-encoding artifacts
float mapSculpture(vec3 p, float t) {
  p.xz = rot2(p.xz, t * 0.55);
  p.xy = rot2(p.xy, 0.25 * sin(t * 0.4));
  vec2 q = vec2(length(p.xz) - 0.36, p.y);
  float torus = length(q) - 0.19;
  float ribs = 0.032 * sin(atan(p.z, p.x) * 6.0 + p.y * 8.0) * cos(p.y * 10.0);
  float core = length(p) - 0.26;
  return min(torus + ribs, core);
}

vec3 calcNormal(vec3 p, float t) {
  vec2 e = vec2(0.0025, 0.0);
  return normalize(vec3(
    mapSculpture(p + e.xyy, t) - mapSculpture(p - e.xyy, t),
    mapSculpture(p + e.yxy, t) - mapSculpture(p - e.yxy, t),
    mapSculpture(p + e.yyx, t) - mapSculpture(p - e.yyx, t)
  ));
}

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 bits = clamp(floor(P_QUANT_BITS + 0.5), 3.0, 10.0);
  float wireVis = clamp(P_WIRE_VIS, 0.0, 1.0);
  float t = iTime * max(P_ROT_SPEED, 0.0);

  vec3 ro = vec3(0.0, 0.28, 2.05);
  vec3 rd = normalize(vec3(uv.x, uv.y - 0.07, -1.48));
  vec3 lDir = normalize(vec3(0.62, 0.78, 0.55));
  vec3 col = mix(vec3(0.06, 0.08, 0.13), vec3(0.16, 0.22, 0.34), smoothstep(-0.4, 0.5, uv.y));

  float dist = 0.05;
  bool hit = false;
  for (int i = 0; i < 64; i++) {
    float h = mapSculpture(ro + rd * dist, t);
    if (h < 0.002) { hit = true; break; }
    dist += h * 0.85;
    if (dist > 6.0) break;
  }

  if (hit) {
    vec3 p = ro + rd * dist;
    vec3 n = calcNormal(p, t);
    // Rotate into object-local coordinates so quantization grid is rigidly locked to mesh vertices
    vec3 pObj = p;
    pObj.xz = rot2(pObj.xz, t * 0.55);
    pObj.xy = rot2(pObj.xy, 0.25 * sin(t * 0.4));

    if (screenX < split) {
      // Left: Low-bit Draco spatial quantization grid + coarse octahedral normal snapping + edgebreaker strip lines
      float qSteps = pow(2.0, bits) * 0.38;
      vec3 pQuant = floor(pObj * qSteps + 0.5) / qSteps;
      vec3 errVec = pObj - pQuant;
      // Quantized faceted normal (coarse oct-encoding)
      float nSteps = max(qSteps * 0.32, 2.0);
      vec3 nQuant = normalize(floor(n * nSteps + 0.5) / nSteps + vec3(1e-4));

      // Edgebreaker traversal triangle-strip grid in object space
      vec3 cellF = fract(pObj * qSteps);
      float edgeDist = min(min(min(cellF.x, 1.0 - cellF.x), min(cellF.y, 1.0 - cellF.y)), abs(cellF.x + cellF.y - 1.0));
      float wire = smoothstep(0.08, 0.015, edgeDist);
      // Color-code quantization prediction residual error magnitude
      float errMag = clamp(length(errVec) * qSteps * 1.6, 0.0, 1.0);
      vec3 alb = mix(vec3(0.24, 0.68, 0.88), vec3(0.98, 0.46, 0.18), errMag);

      float ndl = max(dot(nQuant, lDir), 0.0);
      float spec = pow(max(dot(reflect(-lDir, nQuant), -rd), 0.0), 18.0);
      col = alb * (0.24 + 0.90 * ndl) + vec3(0.9, 0.95, 1.0) * spec * 0.55;
      col = mix(col, vec3(0.96, 0.98, 1.0), wire * wireVis * 0.65);
    } else {
      // Right: High-precision 14-bit Draco-decoded smooth metallic ceramic mesh
      float ndl = max(dot(n, lDir), 0.0);
      float spec = pow(max(dot(reflect(-lDir, n), -rd), 0.0), 48.0);
      float fres = pow(1.0 - max(dot(n, -rd), 0.0), 4.0);
      vec3 alb = mix(vec3(0.22, 0.64, 0.86), vec3(0.84, 0.88, 0.94), 0.5 + 0.5 * n.y);
      col = alb * (0.22 + 0.92 * ndl) + vec3(1.1, 1.05, 0.98) * spec * 0.95 + vec3(0.32, 0.64, 0.96) * fres * 0.65;
    }
  } else if (rd.y < -0.005) {
    float tf = (-0.52 - ro.y) / rd.y;
    if (tf > 0.05 && tf < 14.0) {
      vec3 fp = ro + rd * tf;
      float sh = smoothstep(0.28, 0.68, length(fp.xz));
      vec2 gf = abs(fract(fp.xz * 2.5) - 0.5);
      float grid = smoothstep(0.04, 0.01, min(gf.x, gf.y));
      vec3 fl = mix(vec3(0.11, 0.13, 0.18), vec3(0.24, 0.30, 0.40), grid) * (0.35 + 0.65 * sh);
      col = mix(col, fl, exp(-tf * 0.16));
    }
  }

  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

- [Basis Universal / KTX2 supercompression](https://texelatlas.vercel.app/t/basis-universal-ktx2.md): A compressed glTF can pair Draco geometry with KTX2 textures to cut both streams.

## Sources

1. [primary] google (2016) google/draco. https://github.com/google/draco License: Apache-2.0. (verified via github on 2026-11-29)
2. [primary] KHR_draco_mesh_compression. github.com. https://github.com/KhronosGroup/glTF/tree/main/extensions/2.0/Khronos/KHR_draco_mesh_compression (verified via http on 2026-11-29)

## Cite this entry

Texel. "Draco mesh compression." https://texelatlas.vercel.app/t/draco-mesh-compression/ (accessed 2026-12-01).
