Optimizing & exporting GLBs
Optimize a model in the browser with prune, dedup, weld, quantize, and optional Draco compression, compare the result, and export a self-contained GLB.
On this page (6)
The editor exports a self-contained binary glTF and can optimize it in the browser first. The Optimize & export .glb dialog shows you a before/after report and downloads the result without uploading the model to a server. Files exported without Draco load in a stock THREE.GLTFLoader; Draco-compressed files also need a DRACOLoader, as shown below.
Open the dialog#
Click the header .glb button (or run the export command). The dialog reads the current scene — with every applied transform, material edit, and modifier already baked into the live nodes — and shows a "before" snapshot of size, triangles, and meshes.
The optimization passes#
Toggle which glTF-Transform passes to run. Defaults are Prune, Dedup, and Quantize on:
| Pass | What it does |
|---|---|
| Prune | Drops unused nodes, materials, and accessors. |
| Dedup | Merges duplicate meshes, materials, and textures. |
| Weld | Merges coincident vertices. |
| Quantize | Compresses attribute precision (KHR_mesh_quantization). |
| Draco | KHR_draco_mesh_compression — falls back gracefully if the encoder is unavailable. |
Three rules apply during optimization:
- Skinned meshes skip Weld and Prune — they can collapse vertices across joint boundaries or drop the skin. When a skinned mesh is detected, those two toggles are disabled and a notice explains why. Quantize is skin-safe and stays available.
- Draco supersedes Quantize. The two are incompatible on the same primitive, so when Draco will actually run, the quantize pass is dropped.
- Draco is a soft toggle. It's applied only when the encoder loads and encoding succeeds; on any failure the other passes still apply, the file stays valid, and the report says "Draco unavailable".
Before/after report#
After a run the report shows Size / Triangles / Vertices / Meshes before and after, the size delta as a percentage, and the list of passes that actually ran. Triangle and vertex counts are per node-instance (a deduped mesh reused by two nodes still draws twice), so the numbers match what an engine renders.
Copy the loader snippet#
Copy three.js snippet puts a minimal GLTFLoader example for your exported filename on the clipboard. That basic snippet is ready for exports with Draco turned off:
import { GLTFLoader } from 'three/addons/loaders/GLTFLoader.js';
const loader = new GLTFLoader();
loader.load('asset.glb', (gltf) => {
scene.add(gltf.scene);
// gltf.animations -> THREE.AnimationClip[]
});If you enable Draco, configure DRACOLoader and point it at decoder files you host with your app:
import { GLTFLoader } from 'three/addons/loaders/GLTFLoader.js';
import { DRACOLoader } from 'three/addons/loaders/DRACOLoader.js';
const draco = new DRACOLoader();
draco.setDecoderPath('/draco/');
const loader = new GLTFLoader();
loader.setDRACOLoader(draco);
loader.load('asset.glb', (gltf) => {
scene.add(gltf.scene);
});The /draco/ path is an example. Copy the decoder files into your own public assets and use the path where your application serves them; no third-party CDN is required.
KTX2 textures#
This workflow compresses geometry with quantization or Draco. It can decode KTX2 textures on import, but it does not create new KTX2 textures on export. If your project requires KTX2 output, encode the textures separately before shipping the model.
Export#
Optimize & Export downloads the GLB and confirms with a toast reporting the final size and bytes saved. If the scene has outstanding pack-convention issues, the dialog interposes a confirm step listing the errors and warnings, with Review (abort) or Export anyway — see Creating pack-convention assets.
There is no separate project download in the Editor. Your editing session is autosaved locally as a project record instead, and its .editorproj.json only leaves the browser inside the <id>.creation.zip written by Export creation. Both formats are covered in Studio file formats.
Ask us directly — we answer support mail ourselves.