v0.15
This release focuses on gltfpack improvements and also features small improvements to simplifier to improve quality for some edge cases.
gltfpack highlights
gltfpack improves support for instanced meshes substantially in this release. While previously all instances of the same mesh would be merged together unconditionally which could result in large file sizes and/or memory consumption, by default the instances are kept as is now; -mm
can be used to merge the geometry of the instances together, or alternatively -mi
can be used to encode the instance data using EXT_mesh_gpu_instancing
which, given a compatible loader, can significantly reduce the transmission size and improve loading and rendering performance.
To improve support for large scenes even further, gltfpack is now much more memory efficient, requiring ~40% less memory for processing on average.
The extension that's used by gltfpack to compress geometry, animation and instance data, is now part of glTF and is called EXT_meshopt_compression
; gltfpack was changed accordingly to output compressed files conforming the up-to-date specification. This requires loaders to update to the new extension; https://github.com/zeux/meshoptimizer/tree/master/js contains plugins for three.js and Babylon.js and work is underway to integrate these directly upstream.
For texture compression, gltfpack is switching to toktx
from KTX-Software; this enables support for super-compressed UASTC textures and support for texture scaling during encoding (via -ts
option) which can further reduce the file size. Additionally when using toktx
, gltfpack now pads the textures to a multiple of 4 to ensure compatibility with WebGL, and can optionally (via -tp
option) pad to a power of 2 for older browsers. basisu
command-line tool is still supported for now and automatically used if toktx
is not available.
Finally, gltfpack is now available as a JS library in addition to having command-line executables; the library uses a filesystem-like interface. Please refer to gltf/library.js
for documentation on the two exposed functions.
gltfpack improvements
- Improve support for scenes with many instances of the same mesh;
-mm
is now required to merge these instances together - Implement support for
EXT_mesh_gpu_instancing
via-mi
command line option -km
can now be used to keep unused materials-ke
now keepsextras
on nodes in addition to materials- Improve memory consumption when packing large scenes by 40% on average
- node.js version of gltfpack now supports texture compression if
basisu
ortoktx
are available - Update KTX2 support to track latest KTX2 specification, including DFD changes for ETC1S/UASTC
- Implement support for various PBR.Next extensions including
KHR_materials_transmission
,KHR_materials_ior
,KHR_materials_specular
andKHR_materials_sheen
- Implement support for
toktx
when compressing textures - Implement support for
-ts
that can be used to rescale textures to reduce transmission and memory size - Instead of using 1-255 range for texture quality,
-tq
now accepts a level from 1 to 10, which is tuned to balance compression ratio vs quality for both ETC1S and UASTC - Fix processing for files with unused texture coordinate 0
- Implement support for
-tp
that can be used to rescale images to power-of-two when using texture compression - Remove command line option
-tb
in favor of-tc
; the latter usesKHR_texture_basisu
which should be more widely supported - Remove command line option
-te
; textures are now automatically embedded into.glb
files - Implement JSON report via
-r
option which contains various stats about the resulting glTF scene - Fix texture embedding for images with spaces in the URI
- Fix issues with non-uniform and negative mesh scale
- Implement support for multiple scenes; all scenes are now preserved along with their own node hierarchy
- Implement support for higher bitrate colors via
-vc
option - Fix animation range in some cases, in particular starting time is now preserved when it's not 0, and ending time is preserved when animation doesn't have motion
Miscellaneous improvements
- Improve
meshopt_simplify
edge analysis to track edge loops more carefully; this fixes simplification for some cases where an open border would previously get collapsed incorrectly - Fix a few issues with CMake configuration when meshoptimizer is used as a dependent library
- Fix compilation for old Apple Clang versions
- Reduce size of
meshopt_decoder.js
by 40% before gzip and 5% after gzip meshopt_decoder.js
now has an ES6-friendly variant,meshopt_decoder.module.js
, that can be imported.