v0.14
This release features several new algorithms, mainly aimed at improving the geometry compression, as well as many gltfpack changes with the same goal.
New algorithms
meshopt_optimizeVertexCacheStrip
optimizes triangle lists for vertex cache, favoring long triangle strips over vertex transform efficiency. This function is recommended to use as a replacement formeshopt_optimizeVertexCache
when reducing the compressed geometry size is more valuable than reducing vertex transform cost, or when usingmeshopt_stripify
to produce shorter triangle strip sequences.meshopt_encodeIndexBuffer
now supports the new strip-optimized order better; this required some bitstream changes that can be enabled withmeshopt_encodeIndexVersion(1)
. Version 1 will become the default encoding version in a later release.meshopt_encodeIndexSequence
can be used to compress index buffer data that doesn't represent triangle lists; the encoding is recommended for triangle strip or line lists, but can work with any index sequence (it's less efficient thanmeshopt_encodeIndexBuffer
at compressing triangle lists)
When compressing geometry, using meshopt_optimizeVertexCacheStrip
and meshopt_encodeIndexVersion(1)
is recommended to minimize the distribution size of the resulting meshes; this can make the encoded data ~10% smaller before gzip/zstd compression and up to 20% smaller after gzip/zstd.
Additionally, a set of vertex filters (meshopt_decodeFilterOct
, meshopt_decodeFilterQuat
, meshopt_decodeFilterExp
) was added to support MESHOPT_compression
glTF extension; these are not as useful outside of glTF, and are described in detail in the extension draft. Cumulatively these can substantially reduce the geometry and animation data in glTF files compressed using the extension.
gltfpack highlights
gltfpack incorporates the new algorithms and filters to substantially improve the compression ratios for geometry and animation data. For example, Corset
model from glTF-Sample-Models repository is 20% smaller, BrainStem
model from the same repository is 30% smaller. Most of the changes currently require using a higher compression mode, activated via -cc
command-line option; in a future release -cc
may replace -c
.
The texture compression support was updated to incorporate latest changes in KTX2 / KHR_texture_basisu specification; additionally, gltfpack now supports Basis UASTC encoding via -tu
flag. Note that since gltfpack doesn't support UASTC RDO yet, the UASTC compressed files will be much larger (but much higher quality) compared to ETC1S encoded files.
For easier distribution, gltfpack is now available as an npm package.
gltfpack improvements
- Support all primitive topology modes, except indexed point lists, as an input
- Support for line lists as an output; line meshes were previously discarded
- Improve filtering of redundant geometry streams (removing color/morph delta streams as necessary)
- Implement support for
KHR_materials_clearcoat
extension - Preserve
extras
data on material instances when-ke
flag is used - Add fine-grained control over quantization parameters for animations (
-at
,-ar
,-as
) - Add
-noq
option that can be used to disable quantization (resulting in much larger files) - Improve performance on large scenes with lots of mesh instances
- Improve validation and error messages for invalid input files
- Fix invalid output for files with meshes that don't produce any geometry
Miscellaneous improvements
meshopt_decodeVertexBuffer
now automatically enables SSSE3 SIMD implementation for clang/gcc using__cpuid
-based runtime detection without the need to use extra compile flagsmeshopt_encodeVertexBuffer
now works correctly on empty inputs (count = 0
)- CMake scripts now support CMake versions older than 3.7
- CMake options are now prefixed with
MESHOPT_
(note: this breaks shared library builds, fixed in #129)