A minecraft world rendered in real-time without using LOD. The world is 8256^2 voxels large.
This voxel engine is an implementation of our research paper "NAADF: Globally Illuminated Voxel Worlds Accelerated with Nested Axis-Aligned Distance Fields".
It supports dynamic entites and editing with a world size of up to 16384^3 voxels.
The engine is using the MonoGame framework. In order to support compute shaders, the fork from cpt-max is used.
The data structure consists of 3 layers. 4^3 voxels are grouped into blocks, and 4^3 blocks are again grouped into a chunk. Empty space is using AADFs to accelerate ray traversal. In contrast to Signed Distance Fields (SDF), AADFs are directional along each axis (x-, x+, y-, y+, z-, z+) resulting in significantly improved performance.
The engine uses its own voxel format (*.cvox) which is simply the chunk, block and voxel buffer compressed as a ZIP archive.
World generation happens on the GPU. Editing and entity logic is done on the CPU and then synchronized with the GPU.
- rayTracing.fxh — Ray traversal logic using the NAADFs
- renderFirstHit.fx — Primary ray traversal
- renderGlobalIllum.fx — Secondary ray traversal
- renderSampleRefine.fx — Temporal accumulation for resampling
- renderSpatialResampling.fx — Spatial resampling
- renderTaaSampleReverse.fx — Our TAA approach
- chunkCalc.fx — Data structure generation from raw voxels; includes AADF generation for voxels and blocks
- boundsCalc.fx — AADF generation for chunks
- WorldRenderBase.cs — Render logic on CPU
- WorldData.cs — Data structure logic on CPU
Voxel models with the format *.vox and *.vl32 can be imported. Meshes (*.obj and *.stl) can also be voxelized directly.
When doing any expensive operations (e.g. importing, saving, ...), look into the console window for progress.
Example voxel models can be found from vengi-voxel.
The default scene is Oasis from Hard Cover.
- WASD — Main movement
- Shift — Speed increase
- Left Control — Down
- Space — Up
- Left/Right Arrows — Sun inclination
- F1 — Toggle GUI
- Right click — Camera rotation
- Visual Studio with the ".Net desktop development" package, ".Net Runtime 8.0" and ".Net Runtime 6.0" component
- "MonoGame Framework C# project templates" from extensions
In Settings.cs and settings.fxh some build flags can be configured.
Currently only Windows 10/11 is supported.