Repolode
zeux

zeux/meshoptimizer

C/C++ library for optimizing triangle meshes to render faster on GPUs and to shrink mesh storage and transmission size.

Stars
8,606
Forks
730
Open issues
7
Last commit
8 days ago

What is it?

meshoptimizer is a C and C++ library of algorithms for processing triangle meshes. It reorders vertex and index buffers to improve GPU vertex cache and memory fetch efficiency, reduces overdraw, and quantizes vertex attributes to smaller formats.

The library also provides mesh simplification for generating lower-detail versions of a mesh, along with meshlet and cluster generation for mesh shaders, clustered ray tracing and cluster culling. Its vertex and index codecs compress mesh data losslessly while keeping it decodable with fast performance, and the output stays compressible with general-purpose compressors such as zstd or LZ4.

The core is distributed as a header and C++ source files that can be built with CMake or added directly to a project's build. It is also available as the gltfpack command-line tool for optimizing glTF files, and through bindings for Rust and JavaScript.

Key features

  • 01Reorders indices and vertices to improve GPU vertex cache and fetch locality.
  • 02Provides mesh simplification for generating lower-detail meshes.
  • 03Generates meshlets and cluster bounds for mesh shading and cluster culling.
  • 04Offers lossless vertex and index encoding for compact storage and transmission.
  • 05Includes quantization helpers for normals, positions and texture coordinates.
  • 06Exposes both C and C++ interfaces, usable from other languages through FFI.

Use cases

  • Preprocessing game or real-time renderer assets to reduce vertex cache misses and overdraw.
  • Building LOD chains with mesh simplification for distant objects.
  • Shrinking glTF models for web or mobile delivery with gltfpack.
  • Preparing meshlets for GPUs that support mesh shaders or clustered ray tracing.

Quick start

  1. 1

    Clone the repository at the v1.3 release

    git clone -b v1.3 https://github.com/zeux/meshoptimizer.git
  2. 2

    Build the library with CMake, or add the source files you need to your project's build system

In collections

Topics

FAQ

What is meshoptimizer?
C/C++ library for optimizing triangle meshes to render faster on GPUs and to shrink mesh storage and transmission size. meshoptimizer is a C and C++ library of algorithms for processing triangle meshes. It reorders vertex and index buffers to improve GPU vertex cache and memory fetch efficiency, reduces overdraw, and quantizes vertex attributes to smaller formats.
Is meshoptimizer free to use? What license does it have?
meshoptimizer is open source under the MIT license. Check the license terms before using it in commercial products.
Is meshoptimizer still maintained?
Actively maintained. The last commit to meshoptimizer was on Oct 14, 2026.
What can I use meshoptimizer for?
Preprocessing game or real-time renderer assets to reduce vertex cache misses and overdraw. Building LOD chains with mesh simplification for distant objects. Shrinking glTF models for web or mobile delivery with gltfpack. Preparing meshlets for GPUs that support mesh shaders or clustered ray tracing.
How do I install meshoptimizer?
Clone the repository at the v1.3 release: git clone -b v1.3 https://github.com/zeux/meshoptimizer.git Build the library with CMake, or add the source files you need to your project's build system
Where can I get meshoptimizer?
The source code and installation instructions are on GitHub: https://github.com/zeux/meshoptimizer

Summary generated by AI from the project's README. GitHub stats refresh daily.

Related projects