gltf-asset-optimization

Reduce glTF and GLB asset sizes while keeping them loadable by Bevy 0.18.

540|41|Updated Feb 26, 2024
One-click install
npx skills add https://github.com/elodin-sys/elodin --skill gltf-asset-optimization
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: gltf-asset-optimization
Source: https://github.com/elodin-sys/elodin/tree/main/.cursor/skills/gltf-asset-optimization
Command: npx skills add https://github.com/elodin-sys/elodin --skill gltf-asset-optimization

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires @gltf-transform/cli, and includes scripts (resource) components.

What problem does it solve?

Large .glb and .ktx2 assets tracked by Git LFS inflate clone bandwidth and storage costs, and common compression tools produce files the Bevy 0.18 glTF loader cannot render.

Core Features & Use Cases

  • Bevy-safe optimization: Runs a lossless cleanup (drop unused UVs, weld, join, prune) plus triangle decimation, producing plain glTF 2.0 with no Draco, meshopt, or quantization extensions.
  • Size diagnosis: Inspects models with gltf-transform to determine whether bytes come from geometry or textures before choosing a reduction strategy.
  • Verified output: The bundled script aborts unless extensionsRequired is empty, guaranteeing editor compatibility.
  • Use Case: A 119 MB CAD drone model in assets/ is blowing the Git LFS budget; run the script at a 0.25 keep-ratio to shrink it to ~32 MB and confirm it still renders in the editor.

Quick Start

Optimize the GLB model at assets/my-model.glb to 25 percent of its triangles using the bundled script and verify it loads in the editor.

Frequently Asked Questions about gltf-asset-optimization

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I reduce the size of a GLB file for a Bevy project?

Run the bundled optimize-glb.sh script with a keep-ratio such as 0.25. It performs lossless cleanup (weld, prune, drop unused UVs) then triangle decimation, producing plain glTF 2.0 that Bevy 0.18 can load.

How to shrink Git LFS bandwidth costs from large 3D assets?

Shrink the assets tracked at HEAD, since every clone pulls those LFS objects and bills bandwidth to the repo owner. Alternatively, remove optional assets from LFS and load them on demand via a remote glb URL.

Does Bevy 0.18 support Draco or meshopt compressed glTF files?

No. Bevy 0.18's glTF loader does not support KHR_draco_mesh_compression, EXT_meshopt_compression, KHR_mesh_quantization, KHR_texture_basisu, EXT_texture_webp, or EXT_mesh_gpu_instancing. Output must be plain glTF 2.0 core.

What keep-ratio should I use when simplifying a GLB model?

Use 0.25 as a default for viewport props (about 73% reduction), 0.5 for curved surfaces seen at mid-distance, and 0.1 for small aggressive reductions. Raise the ratio if curved surfaces look faceted.

Why do gaps appear between parts after glTF simplification?

Decimation can open gaps between separate shells in multi-part models. Add --lock-border true to the simplify step to prevent this, though it reduces the achievable size savings on multi-shell models.