Skip to content

v1.1

Latest

Choose a tag to compare

@zeux zeux released this 02 Apr 16:08
· 66 commits to master since this release
dc9d09e
meshoptimizer 1 1

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!

Library improvements

  • New experimental functions for meshlet encoding, meshopt_encodeMeshlet/meshopt_encodeMeshletBound/meshopt_decodeMeshlet/meshopt_decodeMeshletRaw, can be used to compress meshlet topology
  • New experimental functions for opacity micromaps, meshopt_opacityMapMeasure/meshopt_opacityMapRasterize/meshopt_opacityMapCompact/meshopt_opacityMapEntrySize, can be used to rasterize opacity micromaps from UV coordinates and a texture alpha channel
  • New experimental function, meshopt_optimizeMeshletLevel, optimizes meshlet order further to achieve higher compression ratios (with level 3 recommended for good results)
  • New experimental function, meshopt_extractMeshletIndices, extracts meshlet micro-index buffer and vertex references from a cluster index buffer
  • New experimental option for meshopt_simplify* functions, meshopt_SimplifyRegularizeLight, enables regularization with a smaller factor to reduce impact on geometric quality
  • New experimental flag for vertex_lock array in meshopt_simplifyWith* functions, meshopt_SimplifyVertex_Priority, allows tagging individual vertices so that they are more likely to be preserved
  • Improve performance of bounds computation via meshopt_computeMeshletBound/meshopt_computeClusterBounds by 50% on typical inputs
  • Remove index_count % 3 assertions from meshopt_generateVertexRemap/meshopt_remapIndexBuffer/meshopt_optimizeVertexFetch
  • Improve alpha encoding precision in meshopt_encodeFilterColor, reducing error by ~40%
  • Add support for ARM64EC architecture when building with MSVC

Additional improvements

  • Add optimize_clusters_level parameter to clodConfig in clusterlod.h to optimize clusters for better compression
  • Add demo/meshletdec.slang shader as an example for how to decode new meshlet encoding in a compute shader
  • Fix several bugs in gltfpack that could result in invalid outputs in various corner cases (blend weights, joint indices, clearcoat roughness)
  • Reduce MeshoptDecoder JavaScript module size by ~5% and improve several filters to decode ~5% faster
  • Fix imprecise assertions and memory overallocation in MeshoptClusterizer JavaScript module

Thanks to @aalekhm for contributions to this release!