Meshlet Rendering - C++ / GLSL
A Vulkan renderer implementing Nanite style virtualized geometry using mesh shaders and hierarchical LODs.
Project RepositoryAbout Project:
An implementation of the techniques described in Nanite at Home —
building a Nanite-inspired GPU-driven renderer from scratch in C++ and GLSL, using VK_EXT_mesh_shader.
10,000 instances, each with full per-meshlet LOD selection running entirely on the GPU.
Features
- Mesh shader pipeline — task shader + mesh shader via
VK_EXT_mesh_shader; each mesh shader workgroup processes one meshlet - Meshlet generation — clusters of up to 64 vertices / 126 triangles built with meshoptimizer
- Hierarchical LOD DAG — groups of meshlets are iteratively simplified and re-split; the DAG is built via
clodBuildfrom meshoptimizer - Instance level frustum culling — bounding sphere tested against the view frustum before dispatching any meshlets for an instance
- Meshlet level frustum culling — per-meshlet bounding sphere tested in the task shader
- Backface cone culling — meshlets with a normal cone facing away from the camera are rejected in the task shader
References
- Nanite at Home — knnyism. The article this project is based on.
- Kynetic — reference implementation by the article author
- meshoptimizer — meshlet generation and LOD simplification
- Creating a Directed Acyclic Graph from a Mesh — Traverse Research
- Introduction to Turing Mesh Shaders — NVIDIA
Demo:
Screenshots: