Nyx
Nanite-style virtualized geometry renderer on DirectX 12
Install / Use
/learn @moonlovelj/NyxREADME
Nanite-style virtualized geometry renderer on DirectX 12
Nanite-style virtualized geometry renderer on DirectX 12 (built on Microsoft MiniEngine).
Nyx is a personal research project focused on extreme-scale geometry rendering: continuous LOD, GPU-driven culling, mesh-shader dispatch, and demand-driven geometry streaming.
The current stress test scene is Zorah (NVIDIA), with:
- 1,639,668,228 unique triangles
- 18,949,504,889 instanced triangles
Showcase
Test platform for the screenshots/video below: i7-14700KF + RTX 4070 Ti SUPER, rendered at 4K.
Demo video:
<h2 align="center">🎬 Nyx – Nanite-Style Virtualized Geometry Renderer</h2> <p align="center"> <a href="https://www.youtube.com/watch?v=mBEIvRWloCw"> <img src="https://img.youtube.com/vi/mBEIvRWloCw/maxresdefault.jpg" width="1000"> </a> </p> <p align="center"> 4K • 144Hz • 18.9B Instanced Triangles • RTX 4070 Ti SUPER </p>Screenshots:
<p align="center">Lit mode</p>



Core Features
- Nanite-style meshlet hierarchy with DAG/BVH traversal
- GPU-driven rendering via indirect
DispatchMesh - Two-pass frustum + HZB occlusion culling
- Visibility buffer pipeline, then resolve to deferred GBuffer
- Dynamic geometry streaming with residency/address table updates
- Async page IO + LZ4-compressed geometry pages
- Runtime debug/tuning UI (pixel error, culling freeze, debug modes)
Quick Start
Requirements
- Windows 10/11
- Visual Studio 2022
- DX12 GPU with Mesh Shader support
- NuGet package restore enabled
Recommended for large scenes:
- High-VRAM GPU
- 32 GB+ RAM (48 GB+ recommended for rebuilding very large assets)
- NVMe SSD
- Large free disk space
Build
- Open
MiniEngine/SceneViewer/SceneViewer.sln - Select
Release | x64 - Build and run
SceneViewer
By default, SceneViewer loads:
Assets/bunny/bunny.gltf
Zorah Quick Start (Prebuilt Cache)
Building Zorah cache locally can be time-consuming and memory-intensive. If you only want to run the demo, use the prebuilt files:
After download, extract/copy the files to:
MiniEngine/SceneViewer/Assets/zorah_main_public/
Then run:
.\SceneViewer.exe -model .\Assets\zorah_main_public\zorah_main_public.gltf
Command Line
From the SceneViewer output directory, examples:
Typical path (default MiniEngine layout):
MiniEngine\Build\x64\Release\Output\SceneViewer\
.\SceneViewer.exe -model .\Assets\bunny\bunny.gltf
.\SceneViewer.exe -model .\Assets\Jinx\scene.gltf -instances 3600
.\SceneViewer.exe -model .\Assets\bunny\bunny.gltf -rebuild 1
Arguments:
-model <path>: glTF/glb scene path-instances <N>: instance count (clamped to1..1000000)-rebuild 1: force rebuild.minicache
Controls
W A S D/Q E: move- Mouse: look
- Mouse wheel: movement speed scale
Shift: fine movement toggleBackspace: engine tuning/debug UI
Architecture Overview
Offline / First-load Build (.gltf/.glb -> .mini)
- Parse scene/material/camera/animation data
- Build meshlets and meshlet groups
- Iteratively simplify groups for multi-level LOD
- Build hierarchy nodes and metadata
- Pack geometry pages
- Compress pages with LZ4
- Save metadata + blob to
.mini
Runtime Frame Flow
- Instance culling
- DAG/hierarchy culling (frustum + HZB)
- Build indirect mesh dispatch args
- Mesh shader pass 0
- Export depth and generate HZB
- Repeat cull + mesh shader pass 1
- Resolve visibility buffer to GBuffer
- Deferred lighting + post effects
Streaming Runtime
- Page size: 256 KB
- Chunk size: 256 MB
- GPU request mask readback + async page load + LZ4 decompress + upload
Technical Snapshot
- Language: C++20
- Graphics API: DirectX 12
- Shader Model: 6.6
- Agility SDK package:
Microsoft.Direct3D.D3D12 1.616.1 - Meshlet defaults: max vertices 128, max triangles 128, group size 32, BVH node children 8
Repository Layout
MiniEngine/Core: engine core and rendering systemsMiniEngine/Model: model conversion, meshlets, culling, streaming, shadersMiniEngine/SceneViewer: runtime appMiniEngine/SceneViewer/Assets: sample and stress scenes
Notes
- To load custom glTF assets, place them under
MiniEngine/SceneViewer/Assetsand pass the path with-model. - This project uses MiniEngine conventions (right-handed coordinate handling inside the renderer path).
- Large-scene build time depends heavily on CPU, storage bandwidth, and available memory.
Acknowledgements
- Unreal Engine Nanite talks and publications
- Microsoft MiniEngine
- meshoptimizer
- lz4
- cgltf
- imgui
- Inspiration references: nanite-webgpu, vk_lod_clusters
License
- Nyx source code: MIT License (
LICENSE) - Third-party components: original licenses (
THIRD_PARTY_NOTICES.md) - Scene assets may have separate licenses and restrictions; verify before redistribution
Contact
love.jingjing.forever.1314@gmail.com
