GLTFPACK(1)

🌸 NAME 🌸

gltfpack β€” optimize glTF files to improve loading and rendering speed ✨


πŸŽ€ SYNOPSIS πŸŽ€

gltfpack [options] -i input -o output

πŸ¦‹ DESCRIPTION πŸ¦‹

okay so bestie, gltfpack does a lot to your glTF data. Like, it substantially changes it. What it's doing, in order of the vibe:

  • optimizing the meshes for vertex fetch and transform cache
  • quantizing the geometry so it eats less memory and takes up less size
  • merging meshes to bring the draw call count down
  • quantizing and resampling animations so they're smaller and simpler to play back
  • pruning the node tree by removing or collapsing redundant nodes

and when you ask it to, it will also simplify the meshes. periodt. πŸ’…


✨ Basic Options ✨

  • -i input β€” the input file you want processed. Acceptable input formats are .obj, .gltf, and .glb files. 🫢
  • -o output β€” the output file. Supported output formats are .gltf and .glf.
  • -c, -cc β€” produce compressed output. and -cc? it uses better compression. slay. πŸ’–

🌈 Texture Options 🌈

  • -tc β€” convert all textures to KTX2 with BasisU supercompression ✨
  • -tu β€” use UASTC when encoding textures. this is much higher quality and also much larger size, so pick your fighter 😭
  • -tq N β€” set texture encoding quality between 1 and 10 (default: 8)
  • -ts R β€” scale texture dimensions by the ratio R (default: 1, should be between 0 and 1)
  • -tp β€” resize textures to the nearest power of 2 so they conform to WebGL 1 restrictions πŸ‘‘

🧚 Simplification Options 🧚

  • -si R β€” try to simplify meshes to the target size R as a fraction of the original size (default: 1, should be between 0 and 1)
  • -sa β€” simplify aggressively, disregarding quality. like, no thoughts, head empty, quality who πŸ’€

πŸ’œ Vertex Options πŸ’œ

  • -vp N β€” use N-bit quantization for vertex positions (default: 14, should be between 1 and 16)
  • -vt N β€” use N-bit quantization for texture coordinates (default: 12, should be between 1 and 16)
  • -vn N β€” use N-bit quantization for normals and tangents (default: 8, should be between 1 and 16)
  • -vc N β€” use N-bit quantization for colors (default: 8, should be between 1 and 16)

🎡 Animation Options 🎡

  • -at N β€” use N-bit quantization for translations (default: 16, should be between 1 and 24)
  • -ar N β€” use N-bit quantization for rotations (default: 12, should be between 4 and 16)
  • -as N β€” use N-bit quantization for scale (default: 16, should be between 1 and 24)
  • -af N β€” resample animations at N Hz (default: 30)
  • -ac β€” keep constant animation tracks even if they do not modify the node transform 🌸

πŸ™οΈ Scene Options πŸ™οΈ

  • -kn β€” keep named nodes and meshes attached to named nodes so that they can be transformed externally
  • -km β€” keep named materials and disable named material merging
  • -ke β€” keep extra data
  • -mm β€” merge instances of the same mesh together when possible
  • -mi β€” use EXT_mesh_gpu_instancing when serializing multiple mesh instances ✨

πŸ“ Miscellaneous Options πŸ“

  • -cf β€” produce compressed files with fallback for loaders which do not support compression
  • -noq β€” disable quantization. this produces much larger glTF files with no extensions, so, yk, be aware 😭
  • -v β€” verbose output (and it prints the version when used without other options πŸ‘€)
  • -r file β€” write a JSON report to file

πŸ‘‘ AUTHOR πŸ‘‘

gltfpack is shipped with the meshoptimizer library, written by Arseny Kapoulkine. This manual page was written for Debian by Timo Râhling and may be used without restriction. 🫢


okay that's the whole page bestie, and yeah β€” it's the gltfpack page from the General Commands Manual, section 1, so if you ever forget any of this, just man 1 gltfpack and it's all right there. go optimize something iconic πŸ’…βœ¨πŸŽ€