Skip to content

v0.13

Compare
Choose a tag to compare
@zeux zeux released this 28 Nov 07:06
· 1834 commits to master since this release

This release has several new algorithms, SIMD improvements for vertex codec and a lot of gltfpack changes including Basis support.

New algorithms

  • meshopt_simplifyPoints can be used to simplify point clouds. The algorithm is a variant of sloppy simplifier, which means it's fast and not attribute-aware (for now).
  • meshopt_spatialSortRemap and meshopt_spatialSortTriangles can be used to reorder vertices or triangles to increase spatial locality. This is helpful when working with point clouds and triangle meshes with redundant connectivity, and can improve clusterization results.

Performance improvements

  • meshopt_decodeVertexBuffer now has an experimental AVX512 implementation, which is ~10% faster than SSSE3 implementation (it uses 128b vectors and as such carries no extra power cost). It requires AVX512-VBMI2 and AVX512-VL (available on Ice Lake CPUs).
  • meshopt_decodeVertexBuffer now has an experimental WebAssembly SIMD implementation, which is ~3x faster than scalar implementation. It requires a compatible WebAssembly implementation with SIMD enabled (Chrome Canary was used for testing).
  • WebAssembly decoders are now compiled using upstream Emscripten compiler backend, which results in ~5% faster decoding across the board.

Miscellaneous improvements

  • All allocations now use allocation callbacks that can be set through meshopt_setAllocators; previously, allocations from meshopt_IndexAdapter were using global operator new/delete.
  • CMake build system now supports BUILD_SHARED_LIBS
  • CMake build system now can install gltfpack and libmeshoptimizer upon request

gltfpack highlights

This change includes a lot of work on extension specification. As a result, MESHOPT_quantized_geometry extension that was being used before got replaced with a new KHR_mesh_quantization extension (extension PR), and the details of MESHOPT_compression extension have changed substantially to allow for fallback data (extension PR), requiring updates to GLTF loaders. Both three.js (r111) and Babylon.JS (4.1) can be used to load these files, with a custom demo/GLTFLoader.js for three.js and an extension demo/babylon.MESHOPT_compression.js for Babylon.JS.

As a result, gltfpack-produced files now validate cleanly with the most recent glTF validator build (2.0.0-dev.3.0 (November 2019)).

gltfpack also now supports Basis Universal texture supercompression. Encoding files with these textures requires basisu executable which can be built from the official repository. Two container format options are provided:

  • .basis - native container format for Basis; this is supported by three.js and Babylon.JS today, but is likely to be removed in the future because this is not compatible with glTF specification
  • .ktx - KTX2 container format from Khronos that supports Basis supercompression; this is not supported by any renderer at the time of this writing, but this is the route that is being specified (spec PR).

In addition, there were a lot of changes aimed at increasing efficiency and extending feature support, with the full list below.

gltfpack improvements

  • Switch from MESHOPT_quantized_geometry to KHR_mesh_quantization
  • gltfpack-produced files now validate cleanly with the most recent build of glTF validator (PR)
  • Update MESHOPT_compression specification, requires updating JSON loaders (GLTFLoader.js)
  • Implement support for arbitrary number of input bone influences (largest 4 weights are preserved)
  • Implement degenerate triangle filtering (5% triangle/size savings on some models)
  • Use 8-bit morph target deltas when possible (depending on the model, up to 2x memory savings, ~3% size savings); requires three.js r111 to work correctly
  • Add -cf command line option to support compressed data fallback; files produced with this option don't require MESHOPT_compression extension, but loaders that support it will not need to load uncompressed data
  • Add -si R and -sa flags that simplify the meshes using default/aggressive (sloppy) simplification
  • By default, gltfpack now produces normalized normals/tangents; this results in larger but specification-compliant files. This will be improved later, for now you can use -vu to get better compression by using unnormalized normals/tangents.
  • Impement support for Basis / KTX2 compression (-tb to compress textures using basisu into .basis container; -tc to compress textures using KTX2 container which requires extra extensions and isn't supported by renderers yet)
  • Implement support for embedding texture files into buffers (-te flag)
  • Implement support for point clouds
  • Improve animation compression efficiency for translation/scale data by reducing output precision slightly.
  • Improve efficiency of bone influence encoding (~1% size savings)
  • A few correctness fixes, including non-uniform scale handling and quantized color/weight data parsing
  • Morph target names are now preserved using extra.targetNames JSON array