Interactively compress your glTF files with ease. See your changes in realtime before exporting!
👉 Use it here 👈
glTF Compressor is an open source tool for compressing glTF files.
It offers a simple but powerful workflow that we frequently use at Shopify to optimize 3D models. The workflow is designed to help you answer this question:
How much can I compress the textures of my model before it starts looking noticeably bad?
To achieve that, the tool exposes all the textures of your glTF file and allows you to change their:
- Image format (JPEG, PNG, WebP and KTX2).
- Resolution.
- Quality.
All changes happen in realtime so you can see the effects right away. You can quickly compare the original model with the compressed one by holding/releasing the C key on your keyboard.
Additionally, this tool offers a few mesh and animation optimization options that can be applied on export.
We hope you find this tool as useful as we do.
To run locally, simply execute these commands in the root of this repository:
pnpm install
pnpm dev
- Left click and drag to rotate the camera.
- Right click and drag to move the camera.
- Use the scrollwheel to zoom in and out.
- Hold the
Ckey to show the original model. Release it to show the compressed model. - Hold the
Xkey to highlight meshes that use the selected material.
The hosted version at gltf-compressor.com records anonymous usage events via PostHog so we can understand how the tool is used and where to invest. Autocapture and session recording are disabled. Only a small set of explicit events is sent, and no file names or model contents ever leave your browser.
Builds served from any other host (local development, forks, self-hosted deployments) collect nothing. The PostHog key is stored as a GitHub Actions secret on the canonical repository and is not inherited by forks.
This tool relies heavily on Don McCurdy's fantastic glTF Transform library and Hu Song's KTX2-Encoder library.
It also borrows ideas and snippets of code from pmndrs' glTF to JSX converter and various other pmndrs libraries like drei.
The demo model of a couch was made by Eric Chadwick. It can be found here.
Thank you for your amazing work!
