C/C++ library for optimizing triangle meshes to render faster on GPUs and to shrink mesh storage and transmission size.
donmccurdy/glTF-Transform
A TypeScript/JavaScript SDK and CLI for reading, editing, optimizing and writing glTF 2.0 3D models on Node.js and the Web.
- Stars
- 2,063
- Forks
- 223
- Open issues
- 82
- Last commit
- 18 days ago
What is it?
glTF Transform reads, edits and writes 3D models in the glTF 2.0 format. It is aimed at low-level, reproducible changes to a model, such as bundling or splitting files, applying quick fixes, or optimizing an existing asset. The API handles array indices and byte offsets automatically, so developers can work with the document structure without managing binary layout by hand.
The project is split into a core SDK, an extensions package for optional glTF features, a functions package of ready-made transforms such as prune, dedup, resample, Draco and texture compression, and a CLI that applies these functions to single files or in batch. The core runs in both Node.js and browsers, so the same code can serve offline build pipelines or web applications.
The CLI exposes commands for Draco and Meshoptimizer geometry compression, WebP and KTX2/Basis Universal texture compression, and texture resizing via Sharp. A browser-based playground at gltf.report lets users try the scripting API on a loaded model.
Key features
- 01Reads, edits and writes glTF 2.0 and GLB files with automatic index and offset management.
- 02Runs in Node.js and in the browser with the same core API.
- 03Provides ready-made functions such as prune, dedup, resample and Draco compression.
- 04Offers a CLI for optimizing single files or batches, including Meshopt and WebP/KTX2 texture compression.
- 05Supports custom transforms written against the document API.
Use cases
- Optimizing 3D assets for a web viewer by compressing geometry and textures.
- Batch-processing a library of glTF models in a build pipeline.
- Bundling or splitting existing glTF files without re-authoring them in a modeling tool.
- Building glTF models procedurally or developing custom glTF extensions.
Quick start
- 1
Install the CLI globally from npm
npm install --global @gltf-transform/cli - 2
List available CLI commands
gltf-transform --help - 3
Optimize a model in one pass
gltf-transform optimize input.glb output.glb --texture-compress webp
Things to know
- The CLI requires a Node.js LTS version.
- Some texture compression features need Node.js and the Sharp library, so they do not run in the browser.
Topics
FAQ
- What is glTF-Transform?
- A TypeScript/JavaScript SDK and CLI for reading, editing, optimizing and writing glTF 2.0 3D models on Node.js and the Web. glTF Transform reads, edits and writes 3D models in the glTF 2.0 format. It is aimed at low-level, reproducible changes to a model, such as bundling or splitting files, applying quick fixes, or optimizing an existing asset. The API handles array indices and byte offsets automatically, so developers can work with the document structure without managing binary layout by hand.
- Is glTF-Transform free to use? What license does it have?
- glTF-Transform is open source under the MIT license. Check the license terms before using it in commercial products.
- Is glTF-Transform still maintained?
- Actively maintained. The last commit to glTF-Transform was on Oct 20, 2026.
- What can I use glTF-Transform for?
- Optimizing 3D assets for a web viewer by compressing geometry and textures. Batch-processing a library of glTF models in a build pipeline. Bundling or splitting existing glTF files without re-authoring them in a modeling tool. Building glTF models procedurally or developing custom glTF extensions.
- How do I install glTF-Transform?
- Install the CLI globally from npm: npm install --global @gltf-transform/cli List available CLI commands: gltf-transform --help Optimize a model in one pass: gltf-transform optimize input.glb output.glb --texture-compress webp
- Where can I get glTF-Transform?
- The source code and installation instructions are on GitHub: https://github.com/donmccurdy/glTF-Transform
Summary generated by AI from the project's README. GitHub stats refresh daily.
Related projects
Browser-based tool for checking 3D and flatbed scans against CAD: fit features, measure, compare deviation, and reverse engineer into STEP.
An agent-driven skill that turns one interior room photo into an editable Blender scene, a Three.js viewer and a portable GLB model.
Declarative 3D and AR SDK for Jetpack Compose, SwiftUI, the web, Flutter and React Native, built on Filament and ARCore/RealityKit.
An agent skill that guides AI coding agents through creative 3D visualization, turning an idea into a Three.js or Blender scene with recipes, kits and frame capture.
A real-time physically based rendering engine for Android, iOS, Linux, macOS, Windows and WebGL2, designed to be small and efficient on Android.