Meshoptimizer

Latest version: v0.2.20a5

Safety actively analyzes 722460 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 1 of 4

0.23

This release contains many improvements to the meshoptimizer library and some gltfpack enhancements! Some highlights:

Vertex codec v1 (enabled via `meshopt_encodeVertexVersion(1)`) provides increased compression ratio, faster decompression speed, and customizable compression levels. Depending on input data, compressed data can be up to 5-10% smaller and decode up to 10% faster. Additionally, decoding has been further optimized for modern AArch64 CPUs, achieving 20% higher decoding speed on Apple Silicon for both versions (up to 30% overall improvements for v1).

Meshlet builder (`meshopt_buildMeshlets`) now generates fewer disconnected clusters, improving rasterization performance by up to 5% on certain meshes. Additionally, this algorithm now exposes extra options (via `meshopt_buildMeshletsFlex`) to create more axis-aligned clusters and further reduce disconnected clusters. This benefits use cases like clustered ray tracing (for Nvidia RTX) and hierarchical clusterization. For hierarchical clusterization, a new experimental algorithm, `meshopt_partitionClusters`, can be used to build the cluster hierarchy, and `meshopt_computeSphereBounds` can be used to compute the necessary bounds.

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

- `meshopt_encodeVertexVersion` now supports version 1, which results in better compression ratio and faster decoding
- Default vertex codec version does not change in this version; applications that produce compressed data for glTF storage should call `meshopt_encodeVertexVersion(0)` to ensure that future library upgrades do not alter the encoding
- An experimental function, `meshopt_encodeVertexBufferLevel`, allows adjusting the compression level to balance between compression ratio and encoding speed (only available for version 1)
- `meshopt_decodeVertexBuffer` has been further optimized for some AArch64 systems, with up to 20% speedup on Apple Silicon
- `meshopt_decodeVertexVersion`/`meshopt_decodeIndexVersion` allow inspecting the encoded version of the compressed buffer
- `meshopt_simplifyWithAttributes` uses a more careful evaluation of attribute error on attribute seams, improving attribute quality
- `meshopt_buildMeshlets` now produces significantly fewer disconnected clusters, resulting in ~5% rasterization performance improvement in some cases
- `meshopt_buildMeshlets` is significantly faster and uses less memory for sparse mesh subsets (e.g. groups of clusters)
- `meshopt_buildMeshlets*` functions now support `max_vertices=256` (up from 255)
- An experimental algorithm, `meshopt_buildMeshletsFlex`, allows more flexible cluster sizing and using axis-aligned bounds, which can improve clusterization quality for hierarchical clusterization and/or raytracing clusters
- An experimental algorithm, `meshopt_computeSphereBounds`, allows computing sphere bounds for groups of spheres or large meshes (as a complement to `meshopt_computeMeshletBounds` which is only useful for meshlets)
- An experimental algorithm, `meshopt_partitionClusters`, allows partitioning a set of clusters into larger groups, which is useful for hierarchical simplification
- `meshopt_quantizeHalf`/`meshopt_quantizeFloat` are now `extern "C"` to allow proper use from non-C++ code
- `meshopt_simplifyWithAttributes`, `meshopt_simplifyPoints`, `meshopt_optimizeMeshlet`, and `meshopt_EncodeExpClamped` are now stable
- CMake option `MESHOPT_INSTALL` allows disabling installation targets when building the library

gltfpack improvements

- Improve UV seam preservation for meshes with UV mirroring
- Implement support for `KHR_materials_diffuse_transmission` extension
- Allow disabling animation resampling by specifying frequency 0 (`-af 0`)
- Allow per-texture-class control for texture scaling (`-ts`) and limit (`-tl`)
- Preserve primitive `extras` when `-ke` is specified
- Warn when position quantization error is significant and `-vpf` is not specified

JavaScript changes

- `simplifyWithAttributes` and `simplifyPoints` no longer require `MeshoptSimplifier.useExperimentalFeatures`
- npm version of `gltfpack` now requires Node 18+ due to a WASI update

Thanks to hankarun and JulienIcon, as well as Nvidia engineers, for contributions to this release!

0.22

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 using `nointerpolate` attributes
- `meshopt_simplifyWithAttributes` now uses an improved attribute metric that mixes better with positional error and results in more intuitive weighting
- `meshopt_simplifyWithAttributes` now properly tracks attribute errors across attribute discontinuities
- `meshopt_simplifyWithAttributes` no longer spends time or memory on attributes with weight 0, and allows up to 32 scalar attributes
- `meshopt_simplifyWithAttributes` now has better support for `vertex_lock` if the input lock flags are inconsistent on discontinuities
- `meshopt_simplify*` can now collapse some edges that were previously restricted which improves quality and reduces minimum reachable triangle count
- `meshopt_simplify*` now support component pruning via a new experimental `meshopt_SimplifyPrune` option which disregards interior topology and removes components entirely
- `meshopt_simplify*` are now ~5-10% faster on large meshes due to better memory access patterns and improved scheduling
- `meshopt_simplify*` use more accurate computations to improve quality and convergence
- `meshopt_simplifyPoints` uses an improved color metric that results in more intuitive weighting
- `meshopt_buildMeshlets` uses improved heuristics to produce up to ~1% fewer meshlets on large meshes with fewer disconnected meshlets
- `meshopt_decodeFilter*` and `meshopt_encodeFilter*` family of functions are now stable
- `meshopt_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 supports `vertex_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!

0.21

This release contains improvements to the meshoptimizer library and many gltfpack enhancements! Notably, the introduction of sparse and absolute error simplification options in `meshopt_simplify` as well as per-vertex locking in `meshopt_simplifyWithAttributes` improves Nanite-style processing pipelines, meshlet optimization increases rasterization performance further on NVidia hardware, and gltfpack now preserves most data compression / optimization extensions which makes it easier to compose with other glTF processing tools.

Library improvements

- Introduce experimental `meshopt_optimizeMeshlet` algorithm that should be used to optimize individual meshlets for rendering efficiency (mostly affects NVidia hardware but can be used for other vendors as well)
- `meshopt_simplifyWithAttributes` now takes an additional optional array, `vertex_lock`, which allows specifying 1 for individual vertices that should not be moved during simplification (note that this is an interface change and will require source changes; the API continues to be experimental and may see further changes in future releases)
- `meshopt_simplify` options now support a new flag, `meshopt_SimplifySparse`, which significantly increases simplification performance when simplifying small subsets of a larger mesh (note that the error in this mode is relative to the subset, as such use of `meshopt_SimplifyErrorAbsolute` is recommended for consistency)
- `meshopt_simplify` options now support a new flag, `meshopt_SimplifyErrorAbsolute`, which treats target error and the result error as absolute (in mesh coordinate space) instead of relative to mesh extents
- Simplifier now tries harder to prevent triangle flips at a minimal cost to simplification performance and efficiency
- `meshopt_optimizeVertexCache` now needs ~5% less memory and is ~7% faster on Windows
- MESHOPT_SOVERSION CMake option can be used to customize .so version for shared library builds

gltfpack improvements

- Implement support for `KHR_texture_basisu` and `EXT_texture_webp` extensions in the input files; the extensions and images will be preserved as is regardless of compression flags
- Implement support for `EXT_mesh_gpu_instancing` extension in the input files; instanced meshes will be preserved regardless of `-mi` flag
- Implement support for `EXT_meshopt_compression` extension in the input files; files using this extension will be automatically decompressed (and recompressed if `-c`/`-cc` is specified)
- Implement support for `KHR_materials_dispersion` extension
- Implement attribute aware simplification: when `-sv` flag is specified, vertex colors and normals are used during simplification to improve appearance
- Image names are now preserved when present in the input file
- Improve texture compression when using UASTC format: textures are now a little smaller by default, and using low quality levels via `-tq` allows to push compressed size further down at the expense of some quality loss
- Improve behavior of simplification with extremely low factors (eg `-si 0`)
- Improve behavior of quantization when the input file is already quantized
- Improve behavior for textures that are missing on disk when the output file is a GLB
- Automatically fix incorrect MIME type for PNG/JPEG input textures
- Normal attributes are removed for meshes that use unlit materials to reduce size
- Normals can be optionally stored without quantization by using `-vnf` flag (only needed for rare edge cases involving morph targets, prefer `-vn` to increase normal quality)

Thanks to ruby0x1, sciecode and oisyn for contributions to this release!

0.20

This release contains new algorithms and improvements to the meshoptimizer library, many gltfpack enhancements and JS library updates! Importantly, an experimental `meshopt_simplifyWithAttributes` algorithm can take attribute information into account for better appearance, and gltfpack now copies texture files to the output folder when the output format is `.gltf` (which can be disabled via `-tr` option).

Note that attribute-aware simplification is still in development, and there are some known issues with attribute weighting, discontinuities and geometry preservation, so the interface and behavior is subject to change in future releases. Issue https://github.com/zeux/meshoptimizer/issues/158 can be tracked for development progress.

Library improvements

* The default index encoding version for `meshopt_encodeIndexBuffer` and `meshopt_encodeIndexSequence` has been updated to 1. Version 1 has been supported since meshoptimizer 0.14 and is the version that is part of glTF `EXT_meshopt_compression` extension; if legacy version 0 is needed, this can be overridden via `meshopt_encodeIndexVersion`.
* Introduce experimental `meshopt_simplifyWithAttributes` algorithm that takes attribute error into account when running simplification at some cost to geometric error and simplification memory and performance
* Implement `meshopt_dequantizeHalf` which can reverse the quantization done by `meshopt_quantizeHalf` for cases when the data is needed on the CPU
* `meshopt_simplify` now requires ~25% less memory for large meshes
* `meshopt_optimizeVertexCache` is now ~15% faster for large meshes
* `meshopt_simplifyPoints` now consumes less memory and supports per-point colors during simplification; the algorithm is still experimental but will likely be stabilized in a future release. The interface has changed to accommodate optional color attribute input.
* `meshopt_simplify` now prevents triangle flipping better in planar regions (although some issues remain, tracked in https://github.com/zeux/meshoptimizer/issues/346)
* `meshopt_remapVertexBuffer` is now up to 4x faster for deinterleaved streams with small stride
* `meshopt_spatialSortRemap` is no longer experimental (which means it has a stable API like most other functions)
* Fixed vertexfilter.cpp compilation with Emscripten when using Wasm SIMD and SIMD emulation flags

gltfpack improvements

* By default, when targeting `.gltf` files, gltfpack now copies texture files to the output folder. This can be changed by using the new `-tr` option (which also allows to keep texture file references when targeting `.glb` files).
* Implement support for `KHR_materials_anisotropy` extension
* Improve processing performance for large geometry-heavy glTF files
* Preserve custom integer ID attributes (`_ID`, `_BATCHID` and `_FEATURE_ID_n`)
* Fix mesh instancing (`-mi`) transform handling for scenes with non-uniform scale & rotation
* Improve mesh instancing (`-mi`) efficiency on some CAD exports by relaxing mesh merging rules
* Improve animation error analysis for translation tracks when nodes have a large scale
* Identical texture glTF objects are now merged together, which results in significant size/performance improvements on some exports
* Improve point cloud optimization and simplification using the library enhancements
* Implement optional support for floating-point texture coordinate quantization via `-vtf`; this is occasionally useful on scenes with very large texture tiling factors
* Improve support for `.obj` file parsing: vertex colors are now preserved and more data from `.mtl` materials is preserved

JavaScript improvements

* Introduce `reorderPoints` function to MeshoptEncoder; this function is recommended for use with point clouds to reduce data size and improve render locality
* Improve support for JavaScript minifiers when using MeshoptDecoder and WebWorkers
* Improve MeshoptDecoder `useWorkers` behavior: calling the function twice no longer leaks workers, and `useWorkers(0)` can be used to reclaim WebAssembly instance memory
* Introduce experimental `simplifyPoints` and `simplifyWithAttributes` functions to MeshoptSimplifier; these functions may change interface/implementation significantly in future releases and require setting `useExperimentalFeatures` to `true`.

Thanks to LorenRoosendaal, 1d10t and Light7734 for contributions to this release!

0.19

This release contains several meshoptimizer and gltfpack fixes/improvements as well as tweaks for the JavaScript library. Notably, `-vpf` mode in gltfpack can simplify integration into applications that are very sensitive to the scene graph structure as it allows to preserve it better than the default quantization mode does without resorting to disabling quantization entirely.

Library improvements

* Improve `meshopt_decodeVertexBuffer` performance by 5-10% for Intel/AMD and 15-25% for ARM
* Improve scoring heuristic for `meshopt_buildMeshlets` which results in ~2% fewer meshlets with ~5% smaller radius on average
* Improve `meshopt_encodeFilterExp` performance by ~3x and make the encoder more flexible with the new `mode` parameter
* Fix compilation issues with Android NDK 19c and some Emscripten build configurations

gltfpack improvements

* Add floating-point position quantization (`-vpf`) which removes the need for dequantization transforms at some cost to geometry size
* Add support for border locking during simplification via `-slb` which can fix gaps between different meshes
* When using `-vpf` or `-noq`, meshes will usually be attached directly to their source nodes without new intermediate nodes
* Skin names are now preserved when present in the input file
* Fix material optimization when both a metallic-roughness model and a specular-glossiness model was used with inconsistent transparency

JavaScript improvements

* Add exports and update type definitions for MeshoptSimplifier
* Reduce memory consumption of MeshoptSimplifier by 3-4x
* Add WebWorker support to MeshoptDecoder (via `MeshoptDecoder.useWorkers`)

Thanks to donmccurdy, LilyWangLL, daemyung, DavidKorczynski, rafern, Kuranes and mosra for contributions to this release!

0.18

This release contains several gltfpack fixes/improvements as well as small improvements to the simplifier, and support for simplifier in the JavaScript library.

Importantly, gltfpack now uses basis_universal as a library to implement ETC1S and UASTC texture compression. This means that external executables like `basisu`/`toktx` are no longer necessary, and compression of complex scenes is much faster due to support for parallel compression using optimized job pool to maximize resource allocation, but it also means that node.js version of `gltfpack` can no longer compress textures - native `gltfpack` binary should be used instead.

Library improvements

* Add options bitmask to `meshopt_simplify` that can be used to specify `meshopt_SimplifyLockBorder` option; this option is useful when multiple chunks of a single mesh are simplified independently, as it makes sure the simplified versions will connect without gaps
* Fix vertex classification around degenerate triangles which improves simplification quality in rare cases
* Added `MESHOPTIMIZER_ALLOC_CALLCONV` build setting (fixes 403)
* [JavaScript version](https://www.npmjs.com/package/meshoptimizer) of meshoptimizer library now supports mesh simplification via `mesh_simplifier` module

gltfpack improvements

* Add support for KHR_materials_emissive_strength
* Add support for KHR_materials_iridescence
* Switch to parallel texture compressor using internal Basis encoder, and stop supporting texture compression via external executables
* Add command line option `-tj` that can override the degree of parallelism used during texture compression
* Add command line option `-tl` that can limit the texture width/height during texture compression
* Support texture masks in `-tc` option which allows to only compress some textures as ETC1S
* Implement support for normalized attributes during quantization; texture coordinates now use normalized integers, and positions can use normalized integers with `-vpn` command line option
* Preserve interpolation type for STEP animation tracks
* Sort bone influences by weight, not by index, which allows renderers to drop last few bone influences in shader LODs
* Optimize .obj parsing to reduce memory consumption, yielding 2-3x reduction in total memory consumption for some large .obj files

Page 1 of 4

© 2025 Safety CLI Cybersecurity Inc. All Rights Reserved.