This release contains many improvements to the meshoptimizer library and some gltfpack enhancements!
Notably, meshopt_simplifyWithAttributes
has seen significant improvements to attribute handling, meshopt_simplify*
algorithms now produce results with fewer triangles and better quality on meshes with complex topology, meshopt_buildMeshlets
produces slightly more optimal clusterization, and gltfpack will often produce smaller outputs due to geometry deduplication and improved quantization.
The majority of the work on the core library in this release has been sponsored by Valve; thank you!
Note: gltfpack development is done in spare time; potential corporate sponsors should feel free to reach out via e-mail.
Library improvements
- A new algorithm,
meshopt_generateProvokingIndexBuffer
, generates an index buffer that can be used to efficiently render visibility buffers by usingnointerpolate
attributes meshopt_simplifyWithAttributes
now uses an improved attribute metric that mixes better with positional error and results in more intuitive weightingmeshopt_simplifyWithAttributes
now properly tracks attribute errors across attribute discontinuitiesmeshopt_simplifyWithAttributes
no longer spends time or memory on attributes with weight 0, and allows up to 32 scalar attributesmeshopt_simplifyWithAttributes
now has better support forvertex_lock
if the input lock flags are inconsistent on discontinuitiesmeshopt_simplify*
can now collapse some edges that were previously restricted which improves quality and reduces minimum reachable triangle countmeshopt_simplify*
now support component pruning via a new experimentalmeshopt_SimplifyPrune
option which disregards interior topology and removes components entirelymeshopt_simplify*
are now ~5-10% faster on large meshes due to better memory access patterns and improved schedulingmeshopt_simplify*
use more accurate computations to improve quality and convergencemeshopt_simplifyPoints
uses an improved color metric that results in more intuitive weightingmeshopt_buildMeshlets
uses improved heuristics to produce up to ~1% fewer meshlets on large meshes with fewer disconnected meshletsmeshopt_decodeFilter*
andmeshopt_encodeFilter*
family of functions are now stablemeshopt_encodeFilterExp
supports an extra experimental mode,meshopt_EncodeExpClamped
, which can be used on texture coordinates for a better balance between quality and size
gltfpack improvements
- Mesh geometry is now deduplicated based on its contents, which can significantly reduce the size of the output in some cases and improve instancing efficiency
- When quantization is enabled, normals/tangents are quantized before reindexing which can significantly improve the output size/efficiency without affecting quality
- Optionally keep unused vertex attributes if
-kv
is specified; together with-vtf
this can be used to preserve UV mapping on assets without materials/textures - Simplification error can now be specified via a new
-se
command line option - Fix handling of files with Unicode paths on Windows (starting from Windows 10)
- Fix incorrect mesh merging across scene boundaries for multi-scene assets
- Fix rare cases where output JSON would be invalid due to Inf/NaN values
JS improvements
- A new module,
MeshoptClusterizer
, exposes meshlet clustering and bounds computation functionality (by @JolifantoBambla) simplifyWithAttributes
now correctly supportsvertex_lock
argument and expects it to be Uint8Array (instead of JS array) when specified
Thanks to @JolifantoBambla and @Ono-Sendai for contributions to this release!