NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
npm
npm, #3904 most downloaded on npm
Mesh optimization library that makes meshes smaller and faster to render
Latest stable
1.3.0
Last release 1 months ago
25 Sep 2026
Ships fairly regularly
a new release about every 3 months
Most releases are documented
notes for 15 of 18 stable releases
Nothing withdrawn
no release was ever pulled
5 years old
20 releases · first in 2021
Drag across the ruler to compare, or tap a release to open it.
…mode stable, which it now is - no further breaking changes are expected. To improve simplification behavior on double-sided geometry (which can occur…
<p align="center"><img width="802" height="456" alt="image" src="https://github.com/user-attachments/assets/d5eb327f-8eb5-4d91-a97a-f092d06b49fb" /></p>
This release introduces a major new feature, voxel remeshing, in addition to normal generation, a number of simplification enhancements and several smaller improvements.
The first meshoptimizer commit was made on September 8, 2016, a little over ten years ago. Consider this a slightly belated 10-year anniversary release. A decade ago, the library started from a small collection of optimization algorithms that I happened to need at the time, and I definitely did not think it would grow into what it is today. It's now used broadly across the industry, in game engines, content pipelines and tools, and its compression formats are part of glTF. Along the way, many old algorithms had to be studied and improved upon and some new ones - invented. I'm very happy with where the library is today, and looking forward to the next ten years. Thank you to everyone who has used meshoptimizer, reported issues, contributed patches, or supported its development!
A new voxel remesher voxelizes the input mesh at a given resolution, with each voxel storing an approximation of the mesh surface; it then generates a new mesh from the grid, disregarding the original mesh topology and exact vertex positions. The result of meshopt_remesh is a closed mesh with a uniform tessellation that can be used directly or as a base for further simplification. Features closer than a voxel may get merged, gaps smaller than a voxel may get closed, and the interior of the mesh will be filled by default. For best appearance, meshopt_RemeshSolve option optimizes vertex placement to align with the features of the original mesh. Unlike traditional distance field based approaches, this remesher preserves thin sheets at any voxel resolution, although wires (thin one-dimensional geometry) may get erased. This remesher is still experimental and may be improved in future releases; in particular, thin features may have self-intersections and require backface culling for correct rendering.
While this remesher can unlock a variety of use-cases, one possible application is generating a low-poly textured proxy that merges all source meshes, materials and textures into one; an online remesher demo that implements a remesh→simplify→unwrap→retexture pipeline (among other options) is provided as an example.
Since remeshing discards all input attributes, the output needs newly generated normals for lighting. A function to create them, meshopt_generateNormals, is now available; it implements automatic smoothing group detection using a crease angle cutoff and supports optional post-processing that smooths the normals across the neighboring triangles. While particularly useful with remeshed meshes, it's a general purpose algorithm that can be used for any mesh, similarly to meshopt_generateTangents.
Several simplification enhancements improve the behavior of existing functions automatically or add new options to control simplification further. Permissive mode (meshopt_SimplifyPermissive) has been improved, with a few bug fixes and a significant improvement of simplification around geometric borders; this was the final improvement that was needed to make permissive mode stable, which it now is - no further breaking changes are expected. To improve simplification behavior on double-sided geometry (which can occur in remeshed meshes), meshopt_SimplifyPreserveFolds option can be enabled to reduce erosion of sharp creases or edges of double-sided sheets. To improve attribute-aware simplification, both in terms of collapse ordering and the error returned by the simplifier for input geometry with significant attribute variance, meshopt_SimplifyErrorClamped option can be enabled; this option changes LOD selection to be less conservative and is recommended for any uses of attribute-aware simplification. Finally, clusterlod.h has seen an introduction of a new option, simplify_dilate_borders, that can noticeably improve simplification of foliage; the other simplification improvements were applied to clusterlod.h as well, with clamped errors enabled by default.
The majority of the work on the core library in this release has been sponsored by Valve; thank you!
meshopt_remesh, allows generating a new mesh at a given voxel resolution, using an existing mesh as a source but disregarding its topology and exact vertex positionsmeshopt_generateNormals, allows generating normals with automatic smoothing group detection using a crease angle cutoff and optional smoothing post-processingmeshopt_SimplifyPreserveFolds, reduces erosion of boundaries on double-sided geometrymeshopt_SimplifyErrorClamped, adjusts attribute error to prevent excessive reported error in areas of high attribute variancemeshopt_SimplifyPermissive mode of meshopt_simplify* is now stablemeshopt_opacityMap* functions, as well as meshopt_generateTangents, meshopt_filterIndexBuffer* and meshopt_computePositionExponent are now stablemeshopt_encodeVertexBufferBoundmeshopt_decodeIndexBuffer by ~15% when using Clang/GCCmeshopt_buildMeshletsSpatial by ~15% for large meshesmeshopt_partitionClusters by ~10%meshopt_generateVertexRemap for strides that aren't divisible by 4meshopt_encodeFilterExp when bits=24clusterlod.h to improve foliage simplification via clodConfig::simplify_dilate_bordersclusterlod.h when attributes are used, to make LOD selection less conservativeclusterlod.hclusterlod.h would produce empty clusters during simplificationgltfpack when requested via -sv argumentgltfpack when requested via -gn argumentgltfpack when quantization is disabled, resulting in more compact output meshesgltfpack on materials that used texture transform extensiongltfpack on meshes with identical geometry but different quantized UV rangesNote: in preparation for Apple and GitHub deprecating support for macOS/Intel, official macOS binary builds for gltfpack are now AArch64-only. You can still build gltfpack for Intel Macs manually.
Your coding agent can read these notes before it upgrades. Set up the MCP server →
This release introduces a major new feature, tangent frame generation, significantly improves vertex decoding performance on Intel/AMD CPUs and also a
<img width="786" height="442" alt="image" src="https://github.com/user-attachments/assets/ee9cc4f4-7a58-4d75-a93e-b91f2c29a35d" />
This release introduces a major new feature, tangent frame generation, significantly improves vertex decoding performance on Intel/AMD CPUs and also adds several smaller features and improvements. Highlights:
A new tangent frame generator can generate tangents from either indexed or unindexed triangle mesh with positions/normals/texture coordinates. The generator implements MikkTSpace algorithm, but is significantly faster to run (~6-10x faster than mikktspace.c depending on the input structure). Note that the generation result is a per-corner tangent and applying the tangents to the indexed mesh may require splitting source vertices; consult documentation for details. By default, the algorithm uses a modified weighting scheme that significantly improves tangent quality around beveled regions in the mesh, with meshopt_TangentCompatible option provided for cases where exact compatibility with mikktspace.c is important (e.g. normal map baking workflows).
Vertex decoding (meshopt_decodeVertexBuffer) implementation for Intel/AMD CPUs has been significantly revised. The new mostly branchless SSSE3 implementation is usually ~20-45% faster than it was in previous releases, with the gains depending on CPU and the data composition; it's typical to see gains in the upper half of this range for engine-packed data. This implementation is automatically selected on compatible CPUs (SSSE3+POPCNT), with no change in data encoding, so to get this performance boost a library update is sufficient. If the code is compiled with AVX-512/AVX10 support (which is currently only selected at compile time when opted into), the decoding is an additional ~10% faster.
Additionally, new index filtering functions are provided to remove degenerate/duplicate triangles based on positional identity, which can be especially helpful for raytracing performance, a function for computing optimal shared exponent for cluster positions can be used to prepare geometry for upcoming DXR2 Compressed1 format, and clusterlod.h now implements DAG BVH construction via clodBuildHierarchy.
The majority of the work on the core library in this release has been sponsored by Valve; thank you!
meshopt_generateTangentsmeshopt_filterIndexBuffer/meshopt_filterIndexBufferMultimeshopt_encode/decodeMeshlet* functions, meshopt_extractMeshletIndices and meshopt_optimizeMeshletLevel functions, as well as meshopt_SimplifyVertex_Priority and meshopt_SimplifyRegularizeLight flags, are now stable.meshopt_decodeVertexBuffer performance on existing data for Intel/AMD CPUs (20-45% faster depending on CPU and data characteristics)meshopt_partitionClusters on larger partition sizes (~2x for target_size 64, ~200x for 1024)meshopt_optimizeMeshletLevel with level 1+ (~0.5% gains)meshopt_encodeFilterExp with a shared exponent mode if the input contains exact zeroesMESHOPTIMIZER_CLUSTERIZER_INDEXLIMIT defineMESHOPTIMIZER_VERTEXCODEC_ZEROCOPY define for slightly faster decoding (disabled by default as it does not work well with write-combined memory)clusterlod.h now implements DAG BVH construction via clodBuildHierarchy for efficient hierarchical cut selectiongltfpack when requested via -gt argumentMeshoptTangents JavaScript module with the new tangent space generatormeshopt_decoder.js Wasm SIMD implementation corner case when using v1 format and highest compression (part of 1.1.1 patch release)meshopt_decoder.js when using WebWorkers via useWorkers (part of 1.1.1 patch release)meshopt_decoder.js by 5-10%gltfpack (mesh merging with negative scales no longer flips tangent frames, more careful handling of animation tracks with zero scale)This release is planned to be just for NPM, to address a potentially problematic bug with Wasm SIMD decoding, as well as a number of smaller bugs.
This release is planned to be just for NPM, to address a potentially
problematic bug with Wasm SIMD decoding, as well as a number of smaller
bugs.
MeshoptDecoder:
MeshoptSimplifier:
MeshoptEncoder:
MeshoptClusterizer:
This release introduces two new major features, meshlet compression and opacity micromaps, as well as several small features and improvements. Highlig
<img width="600" height="400" alt="meshoptimizer 1 1" src="https://github.com/user-attachments/assets/4e89e240-13b8-40fe-a88c-fa49ed8e0c2b" />
This release introduces two new major features, meshlet compression and opacity micromaps, as well as several small features and improvements. Highlights:
A new meshlet codec can compress meshlet topology (micro-index and vertex reference data), exploiting inherent locality and designed for extremely fast CPU decompression. Each meshlet is encoded independently, allowing flexibility in structuring the runtime storage and parallelism. Meshlets can be decoded into common runtime formats (3 or 4 bytes per triangle, 2 or 4 bytes per vertex reference) for direct GPU consumption. For further size savings, the output of the encoder can be compressed using general purpose compressors such as Zstandard. Decoder is heavily optimized and can directly target write-combined memory; you can expect it to run at 7-10 GB/s on modern desktop CPUs. For applications that do streaming processing on the GPU, an example compute shader decoder is provided and can reach 150+ GB/s on RTX 5070.
Opacity micromap rasterization is now supported; a set of functions can generate hardware ready opacity micromap data from mesh UVs and a texture with an alpha channel. The resulting micromap data can be used directly in Vulkan via VK_EXT_opacity_micromap or in DirectX via DXR1.2. Each triangle is subdivided according to its UV footprint into a 4^N microtriangle grid; micro-triangles can use a 2-state (1 bit) or 4-state (2 bits) representation. 4-state representation is useful to accelerate shader invocations to confirm hit opacity via a texture lookup, whereas 2-state representation (or a forced 2-state fallback for a 4-state representation) can be used to completely eliminate shader invocations and reach maximum tracing performance. To minimize the memory overhead, the maps are reused between triangles using a per-triangle OMM index buffer with generated special indices for triangles with consistent state.
The majority of the work on the core library in this release has been sponsored by Valve; thank you!
meshopt_encodeMeshlet/meshopt_encodeMeshletBound/meshopt_decodeMeshlet/meshopt_decodeMeshletRaw, can be used to compress meshlet topologymeshopt_opacityMapMeasure/meshopt_opacityMapRasterize/meshopt_opacityMapCompact/meshopt_opacityMapEntrySize, can be used to rasterize opacity micromaps from UV coordinates and a texture alpha channelmeshopt_optimizeMeshletLevel, optimizes meshlet order further to achieve higher compression ratios (with level 3 recommended for good results)meshopt_extractMeshletIndices, extracts meshlet micro-index buffer and vertex references from a cluster index buffermeshopt_simplify* functions, meshopt_SimplifyRegularizeLight, enables regularization with a smaller factor to reduce impact on geometric qualityvertex_lock array in meshopt_simplifyWith* functions, meshopt_SimplifyVertex_Priority, allows tagging individual vertices so that they are more likely to be preservedmeshopt_computeMeshletBound/meshopt_computeClusterBounds by 50% on typical inputsindex_count % 3 assertions from meshopt_generateVertexRemap/meshopt_remapIndexBuffer/meshopt_optimizeVertexFetchmeshopt_encodeFilterColor, reducing error by ~40%optimize_clusters_level parameter to clodConfig in clusterlod.h to optimize clusters for better compressiondemo/meshletdec.slang shader as an example for how to decode new meshlet encoding in a compute shadergltfpack that could result in invalid outputs in various corner cases (blend weights, joint indices, clearcoat roughness)MeshoptDecoder JavaScript module size by ~5% and improve several filters to decode ~5% fasterMeshoptClusterizer JavaScript moduleThanks to @aalekhm for contributions to this release!
Nothing published for this version
This release focuses on improvements to clusterization, simplification and partitioning algorithms, as well as stabilization - with the exception of p
This release focuses on improvements to clusterization, simplification and partitioning algorithms, as well as stabilization - with the exception of permissive simplification mode, all other library functionality introduced in prior releases is now considered stable.
Highlights:
Clusterization algorithms (meshopt_buildMeshlets/meshopt_buildMeshletsFlex, meshopt_buildMeshletsSpatial) are now faster and, in the case of spatial clusterization, produce higher-quality clusters for vertex-bound meshlets. Additionally, meshlet builders no longer align local index data to 4 bytes, which simplifies memory management and removes alignment restrictions on triangle limits. When cluster partitioning is required, meshopt_partitionClusters now produces better partitioning for disconnected clusters which improves quality of DAGs for hierarchical clusterization.
Speaking of hierarchical clusterization, a new single-header library clusterlod.h is now developed and maintained alongside meshoptimizer. This library implements continuous level of detail by generating a hierarchy of clusters that are progressively grouped and simplified, similarly to Nanite. It leverages meshoptimizer algorithms for internal processing, and can either be used as-is or as a starting point for implementing a custom solution - the code is structured to be easy to understand and modify. Some relevant improvements are described in Billions of triangles in minutes blog post.
New simplification features added in the last release have seen further quality improvements as well; both meshopt_simplifyWithUpdate and the meshopt_SimplifyPermissive option now generate higher-quality outputs. Permissive mode option specifically is still considered experimental, and future releases may improve or change behavior further.
All other experimental library functions and options have been promoted to stable status. This means that future releases will be API compatible (code will continue compiling), ABI compatible (code can link to a shared library build of meshoptimizer which can then be updated independently) and behavior compatible (results may improve in future releases, but these improvements should not require adjustments to the calling code) as far as current 1.0 functionality is concerned.
The vertex encoding functions (meshopt_encodeVertexBuffer/meshopt_encodeVertexBufferLevel) now encode v1 data by default. This can be overridden for applications that need to produce data in v0 format, especially if producing data for EXT_meshopt_compression extension which only supports v0. This version only switches the encoding default; support for encoding and decoding v0/v1 will be provided in perpetuity.
gltfpack now supports the new KHR_meshopt_compression extension via -cz option (or -ce khr which allows specifying compression level independently; -cz is equivalent to -ce khr -cc), which provides better compression compared to the existing EXT_meshopt_compression extension. Note that loader support for this extension is not yet widely available, and by default gltfpack continues to use EXT_meshopt_compression when compression is requested.
Finally, JavaScript bindings have been updated to use ES modules instead of CommonJS modules, which may require adjustments to import paths. For the MeshoptDecoder module, a CommonJS variant meshopt_decoder.cjs is still provided for compatibility (but note a different file extension, required for correct handling by some bundlers).
The majority of the work on the core library in this release has been sponsored by Valve; thank you!
meshopt_encodeVertexBuffer now uses format version 1 by default, which requires meshoptimizer v0.23 or later to decode. Applications that encode data for EXT_meshopt_compression glTF extensions need to switch to version 0 by using meshopt_encodeVertexVersion or meshopt_encodeVertexBufferLevel functions.meshopt_buildMeshlets and other variants) no longer align local index data for each meshlet by 4 bytes; applications that use writePackedPrimitiveIndices4x8NV intrinsic (from NV_mesh_shader extension) may need to align each meshlet manually.meshopt_encodeVertexVersion/meshopt_encodeVertexBufferLevel can be used to encode data using version 0 if neededmeshopt_buildMeshlets* functionsmeshopt_buildMeshletsFlex, meshopt_buildMeshletsSpatial, meshopt_decodeFilterColor, meshopt_encodeFilterColor and meshopt_generatePositionRemap functions are now stablemeshopt_simplifyWithUpdate and meshopt_simplifySloppy functions, as well as meshopt_SimplifyRegularize flag, are now stablemeshopt_partitionClusters now returns slightly tighter partitions (now containing up to partition_size + partition_size / 3 clusters)meshopt_partitionClusters now merges spatially adjacent partitions if vertex positions are provided, even if the input clusters do not share verticescone_weight from meshopt_buildMeshletsFlex (this was an experimental feature, superseded by meshopt_buildMeshletsSpatial)meshopt_buildMeshlets* functions for sparse mesh subsetsmeshopt_simplifyWithUpdate (reduced position deformation, attributes are now updated on more vertices, attribute continuity is preserved in permissive mode)meshopt_SimplifyPermissive for attribute discontinuities without protection bitsmeshopt_simplify* functions when using meshopt_SimplifySparse flag on very sparse mesh subsetsmeshopt_buildMeshletsSpatial on meshes with vertex-bound meshletsmeshopt_buildMeshletsSpatial by 10-25% on x64 and AArch64meshopt_buildMeshlets by 20-30% on meshes with many attribute discontinuitiesmeshopt_decodeFilter* function family by 15-45% on AArch64meshopt_decodeFilterQuat by 10-20% on x64meshopt_simplifySloppymeshopt_buildMeshletsFlex, meshopt_buildMeshletsSpatial, meshopt_partitionClusters)KHR_meshopt_compression extension (via -ce khr or -cz command line options)_COLOR_0) when using mesh instancing-tc and -tw command line options are used together)-vtf on meshes with UV mapping issues-vtf is not specifiedmeshopt_decoder.cjs is still provided for compatibility (note a different extension).MeshoptEncoder.encodeVertexBuffer by default; for compatibility with EXT_meshopt_compression extension, MeshoptEncoder.encodeGltfBuffer continues to default to v0MeshoptSimplifier.generatePositionRemap functionMeshoptClusterizer.buildMeshletsFlex and MeshoptClusterizer.buildMeshletsSpatial functionsversion argument to MeshoptEncoder.encodeGltfBuffer to support encoding v1 dataThanks to @minitoine, @OfficialKris and @ynnob for contributions to this release!
Nothing published for this version
Nothing published for this version
This release contains many improvements to the meshoptimizer library, with a particular focus on simplification algorithms, as well as several new glt
This release contains many improvements to the meshoptimizer library, with a particular focus on simplification algorithms, as well as several new gltfpack features. Highlights:
<a href="https://github.com/user-attachments/assets/82a11f58-05d2-41c7-92ad-e24265216373"><img src="https://github.com/user-attachments/assets/82a11f58-05d2-41c7-92ad-e24265216373" width="50%" height="50%" /></a>
New simplification function meshopt_simplifyWithUpdate optimizes vertex positions and attributes for higher-quality LODs, and a new permissive simplification mode enabled via meshopt_SimplifyPermissive flag allows simplification of faceted meshes with selective preservation of attribute discontinuities. Additionally, meshopt_SimplifyRegularize flag improves tessellation quality and appearance of deformable meshes, sloppy simplifier (meshopt_simplifySloppy) implements vertex locking support, and multiple improvements to the main simplification algorithms improve quality at the same triangle count by default.
gltfpack now supports encoding WebP images via -tw option, which enables further reduction in compressed asset sizes at some memory cost at runtime. Additionally, gltfpack exposes permissive simplification via -sp option, which can simplify meshes further while preserving appearance much better compared to aggressive simplification.
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.
meshopt_simplifyWithUpdate, enhances attribute-aware simplification by computing optimal positions/attributes for the simplified mesh, allowing to increase quality of lower levels of detail at additional vertex memory costmeshopt_SimplifyPermissive, allows simplification across attribute discontinuities, with optional support for protecting individual vertices with bit flag meshopt_SimplifyVertex_Protect on lock flags specified via vertex_lockmeshopt_SimplifyRegularize, results in more regular tessellation at some cost to shape preservation, which is particularly valuable for deformable meshesmeshopt_generatePositionRemap, creates a table mapping vertices to the canonical vertex with the same position (which can be used to prepare data for various algorithms like simplification and partitioning)meshopt_encodeFilterColor/meshopt_decodeFilterColor, can be used to further improve compression ratio on quantized RGBA streamsmeshopt_simplifySloppy now has an extra argument, vertex_lock, allowing to lock individual vertices to preserve mesh boundariesmeshopt_analyzeCoverage, meshopt_computeSphereBounds, meshopt_encodeVertexBufferLevel, meshopt_generateVertexRemapCustom, meshopt_partitionClusters and meshopt_spatialClusterPoints functions are now stablemeshopt_simplifyPrune function and meshopt_SimplifyPrune flag are now stablemeshopt_SimplifyPrune was enabledmeshopt_optimizeOverdraw by ~15%MESHOPTIMIZER_ALLOC_EXPORT is defined)-tw which compresses textures to WebP format, resulting in smaller files at the expense of more memory consumption compared to Basis Universal.-sp which enables permissive simplification, allowing the simplifier to collapse edges across attribute discontinuities (as a much higher quality alternative to aggressive simplification)-vi to use interleaved vertices instead of separate streams; this partially disables compression in -cc mode-sv is no longer necessary but is maintained for compatibilityMESHOPT_GLTFPACK_BASISU_PATH for consistencyMeshoptEncoder.encodeVertexBufferLevelMeshoptClusterizer.computeSphereBounds and MeshoptSimplifier.simplifyPrune functionsMeshoptDecoder.decodeVertexBuffer and MeshoptEncoder.encodeColorMeshoptSimplifier now supports experimental simplifySloppy, simplifyWithUpdate functions and experimental "Regularize" / "Permissive" flags for simplify*simplifyWithAttributes with no attributesThanks to @jopadan and @toge for contributions to this release!
This release contains many improvements to the meshoptimizer library and some gltfpack fixes! Some highlights:
This release contains many improvements to the meshoptimizer library and some gltfpack fixes! Some highlights:
New meshlet builder (meshopt_buildMeshletsSpatial) designed for raytracing workloads optimizes meshlets using SAH cost and can be used with NVidia cluster acceleration structure extensions. The generated meshlets follow the same format and data layout as other meshlet builders, thus the functions can be used interchangeably based on the expected usage of a given mesh.
An assortment of new experimental functions in various areas of the library help reindex meshes with tolerance (meshopt_generateVertexRemapCustom), remove isolated components after isosurface meshing (meshopt_simplifyPrune), rasterize point clouds via compute using spatially optimized clusters (meshopt_spatialClusterPoints), and implement adaptive view dependent distance based culling for small objects (meshopt_analyzeCoverage).
Cluster partitioning (meshopt_partitionClusters) now accepts vertex positions as an optional input, improving spatial locality of returned partitions.
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.
meshopt_buildMeshletsSpatial, generates meshlets that are optimized for ray tracing workloads and can be used with NVidia cluster acceleration structure extensionsmeshopt_generateVertexRemapCustom, generates vertex remap for reindexing using a custom comparison function for vertex attributes, which can be used to weld vertices with per-attribute tolerancemeshopt_simplifyPrune, removes connected components under the specified threshold, which is useful for simplification and isosurface cleanupmeshopt_spatialClusterPoints, subdivides the input point cloud into uniformly sized chunks, which is useful for compute driven renderingmeshopt_analyzeCoverage, returns rasterized coverage from three cardinal axes, which is useful for distance based cullingmeshopt_encodeVertexBufferLevel now accepts encoding version as an optional parameter for multi-threaded multi-versioned encodingmeshopt_partitionClusters now accepts vertex positions as an optional input, which helps reduce spatial bounds for partitionsmeshopt_partitionClusters is now ~2x faster on typical inputsmeshopt_spatialSort* functions now use more precise Morton codes, yielding more accurate order for large meshesmeshopt_decodeIndexBuffer has been optimized to decode ~10% faster when using MSVCmeshopt_computeMeshletBounds and other bounds functions now compute 1-2% tighter bounding spheresmeshopt_analyzeOverdraw now correctly computes depth information which results in more accurate statisticsmeshopt_simplify now correctly handles negative zero components in input positionsmeshopt_generateProvokingIndexBuffer and meshopt_spatialSortTriangles are now stableThanks to @axmand and @pm4rtx for contributions to this release!
This release contains many improvements to the meshoptimizer library and some gltfpack enhancements! Some highlights:
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.
meshopt_encodeVertexVersion now supports version 1, which results in better compression ratio and faster decodingmeshopt_encodeVertexVersion(0) to ensure that future library upgrades do not alter the encodingmeshopt_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 Siliconmeshopt_decodeVertexVersion/meshopt_decodeIndexVersion allow inspecting the encoded version of the compressed buffermeshopt_simplifyWithAttributes uses a more careful evaluation of attribute error on attribute seams, improving attribute qualitymeshopt_buildMeshlets now produces significantly fewer disconnected clusters, resulting in ~5% rasterization performance improvement in some casesmeshopt_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)meshopt_buildMeshletsFlex, allows more flexible cluster sizing and using axis-aligned bounds, which can improve clusterization quality for hierarchical clusterization and/or raytracing clustersmeshopt_computeSphereBounds, allows computing sphere bounds for groups of spheres or large meshes (as a complement to meshopt_computeMeshletBounds which is only useful for meshlets)meshopt_partitionClusters, allows partitioning a set of clusters into larger groups, which is useful for hierarchical simplificationmeshopt_quantizeHalf/meshopt_quantizeFloat are now extern "C" to allow proper use from non-C++ codemeshopt_simplifyWithAttributes, meshopt_simplifyPoints, meshopt_optimizeMeshlet, and meshopt_EncodeExpClamped are now stableMESHOPT_INSTALL allows disabling installation targets when building the libraryKHR_materials_diffuse_transmission extension-af 0)-ts) and limit (-tl)extras when -ke is specified-vpf is not specifiedsimplifyWithAttributes and simplifyPoints no longer require MeshoptSimplifier.useExperimentalFeaturesgltfpack now requires Node 18+ due to a WASI updateThanks to @hankarun and @JulienIcon, as well as Nvidia engineers, for contributions to this release!
This release contains many improvements to the meshoptimizer library and some gltfpack enhancements!
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.
meshopt_generateProvokingIndexBuffer, generates an index buffer that can be used to efficiently render visibility buffers by using nointerpolate attributesmeshopt_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 for vertex_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 experimental meshopt_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* and meshopt_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-kv is specified; together with -vtf this can be used to preserve UV mapping on assets without materials/textures-se command line optionMeshoptClusterizer, 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 specifiedThanks to @JolifantoBambla and @Ono-Sendai for contributions to this release!
This release contains improvements to the meshoptimizer library and many gltfpack enhancements! Notably, the introduction of sparse and absolute error
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.
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 extentsmeshopt_optimizeVertexCache now needs ~5% less memory and is ~7% faster on WindowsKHR_texture_basisu and EXT_texture_webp extensions in the input files; the extensions and images will be preserved as is regardless of compression flagsEXT_mesh_gpu_instancing extension in the input files; instanced meshes will be preserved regardless of -mi flagEXT_meshopt_compression extension in the input files; files using this extension will be automatically decompressed (and recompressed if -c/-cc is specified)KHR_materials_dispersion extension-sv flag is specified, vertex colors and normals are used during simplification to improve appearance-tq allows to push compressed size further down at the expense of some quality loss-si 0)-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!
This release contains new algorithms and improvements to the meshoptimizer library, many gltfpack enhancements and JS library updates! Importantly, an
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.
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.meshopt_simplifyWithAttributes algorithm that takes attribute error into account when running simplification at some cost to geometric error and simplification memory and performancemeshopt_dequantizeHalf which can reverse the quantization done by meshopt_quantizeHalf for cases when the data is needed on the CPUmeshopt_simplify now requires ~25% less memory for large meshesmeshopt_optimizeVertexCache is now ~15% faster for large meshesmeshopt_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 stridemeshopt_spatialSortRemap is no longer experimental (which means it has a stable API like most other functions).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).KHR_materials_anisotropy extension_ID, _BATCHID and _FEATURE_ID_n)-mi) transform handling for scenes with non-uniform scale & rotation-mi) efficiency on some CAD exports by relaxing mesh merging rules-vtf; this is occasionally useful on scenes with very large texture tiling factors.obj file parsing: vertex colors are now preserved and more data from .mtl materials is preservedreorderPoints function to MeshoptEncoder; this function is recommended for use with point clouds to reduce data size and improve render localityuseWorkers behavior: calling the function twice no longer leaks workers, and useWorkers(0) can be used to reclaim WebAssembly instance memorysimplifyPoints 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!
This release contains several meshoptimizer and gltfpack fixes/improvements as well as tweaks for the JavaScript library. Notably, -vpf mode in gltfpa
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.
meshopt_decodeVertexBuffer performance by 5-10% for Intel/AMD and 15-25% for ARMmeshopt_buildMeshlets which results in ~2% fewer meshlets with ~5% smaller radius on averagemeshopt_encodeFilterExp performance by ~3x and make the encoder more flexible with the new mode parameter-vpf) which removes the need for dequantization transforms at some cost to geometry size-slb which can fix gaps between different meshes-vpf or -noq, meshes will usually be attached directly to their source nodes without new intermediate nodesMeshoptDecoder.useWorkers)Thanks to @donmccurdy, @LilyWangLL, @daemyung, @DavidKorczynski, @rafern, @Kuranes and @mosra for contributions to this release!
Nothing published for this version
This release contains several gltfpack fixes/improvements as well as small improvements to the simplifier, and support for simplifier in the JavaScrip
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.
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 gapsMESHOPTIMIZER_ALLOC_CALLCONV build setting (fixes #403)mesh_simplifier module-tj that can override the degree of parallelism used during texture compression-tl that can limit the texture width/height during texture compression-tc option which allows to only compress some textures as ETC1S-vpn command line optionThis release contains several gltfpack fixes/improvements as well as small tweaks to the core library, and a new JavaScript package, meshoptimizer.
This release contains several gltfpack fixes/improvements as well as small tweaks to the core library, and a new JavaScript package, meshoptimizer.
meshopt_encodeFilter* functions that encode floating point data in a format that can be decoded using decode filters; this can be used together with vertex codec and is mostly designed to support EXT_meshopt_compression glTF extension.-tfy) when using texture compression-tu normal now enables UASTC only for normal maps)KHR_lights_punctual extensionKHR_materials_volume extension is usedTo facilitate integration of meshoptimizer compression into web applications, several algorithms that the library provides, specifically mesh reordering, vertex/index compression as well as attribute filters, are now provided as a standalone JS package available through NPM, meshoptimizer.
The package provides meshopt_decoder module that can be used to decompress meshes, and meshopt_encoder module that can be used to optimize and compress meshes. Both modules are particularly important for applications that work with EXT_meshopt_compression glTF extension.
Note that these JS modules are low-level and are intended to be used in content pipeline tools (like glTF-Transform) or renderers (like three.js or Babylon.js); it's comparatively rare that these would be useful to integrate directly into a web application as opposed to a high-level library dependency.
Nothing published for this version
This release features many library changes including a few new algorithms and substantial improvements in existing algorithms, notably making mesh sim
This release features many library changes including a few new algorithms and substantial improvements in existing algorithms, notably making mesh simplification and clusterization better, as well as gltfpack fixes and improvements.
meshopt_simplify now has an extra output parameter, result_error, which will contain the relative simplification error (which can be converted to absolute with meshopt_simplifyScale)meshopt_simplifySloppy interface has changed to align with meshopt_simplify: the function now expects a larger output index buffer size and accepts an input error that restricts simpification as well as an output error.meshopt_simplify now tries to avoid simplifications that result in triangle flips; this substantially improves triangulation quality at a moderate performance cost.meshopt_buildMeshlets interface has changed to allow for almost arbitrary meshlet vertex/triangle limits by outputting three separate arrays of meshlet data instead of one; the resulting layout is also more compact and is often more GPU-friendly.meshopt_buildMeshlets now implements a new, more expensive algorithm that generates meshlets that are optimized for a balance of vertex reuse, spatial coherency and cone culling efficiency, controlled with an extra cone_weight parameter. The old linear-time algorithm is still available as meshopt_buildMeshletsScan.meshopt_generateTessellationIndexBuffer, that can be used to generate a special index buffer that, together with hardware tessellation stage, can efficiently implement crack-free PN-AEN tessellation for arbitrary meshes.meshopt_decodeVertexBuffer, making it ~5% fastermeshopt_decodeFilter*) when vertex count wasn't aligned by 4meshopt_decodeIndexBufferOne column per quarter.