A voxel game with unrealistic ambitions.
C++ and Vulkan.
Voxels are stored in a simple two-level grid consisting of top-level and bottom-level chunks. I sometimes call it a brickmap, but I haven't read the paper so I don't know if that's accurate. Top- and bottom-level chunks both hold 8x8x8 (512) elements, but homogeneous chunks can be collapsed into a single value. Bottom-level bricks additionally store a bitmask indicating the "occupancy" of each voxel. The occupancy bitmask is used to improve cache coherency in ray tracing.
A fixed memory pool is employed for the grid structure. It is mirrored exactly on the GPU side, so propagating updates from the CPU to the GPU is as simple as marking which pages of the pool were touched by a modification, then copying them into the GPU-side representation.
All voxels are rendered with ray tracing using hierarchical DDA. Voxel materials are either simple cubes (textured or not), or they can be "sub-grids" containing their own instanced grid. MagicaVoxel is used to author sub-grid materials.
The renderer has two lighting methods that can be switched between at runtime: a spatial illuminance caching method based on DDGI, and path tracing. Path tracing is intended to be used as a reference, but is fast enough to be playable with the spatial denoiser enabled.
Light is emitted by either voxels or by explicitly sampled local or directional lights.
The renderer also supports translucent and mirror voxel materials.
Rasterized meshes (for dynamic game entities) can be arbitrarily placed and lit, but do not themselves affect lighting.
The game supports multiplayer using a client-server architecture. It is extremely slow and insecure, so please only connect to your friends' servers.
Ensure submodules are fetched by cloning the repository recursively. Then, get a modern version of CMake and do the mkdir build && cd build && cmake ... All dependencies are vendored or fetched with FetchContent, so nothing needs to be installed manually.
The game should build and run on any sufficiently modern desktop GPU on Windows and Linux (I only test on Windows however). If something doesn't work, please create an issue.
This project was featured in GP-Direct 2025: https://youtu.be/e9qK6EtqB-Q
A link to the clip of this project by itself is here: https://youtu.be/Dxa1-D04SMU
- GLFW
- GLM
- volk
- vk-bootstrap
- Vulkan Memory Allocator
- glslang
- Dear ImGui
- ImPlot
- FidelityFX Super Resolution 2 (my fork)
- Tracy
- EnTT
- Jolt Physics
- FastNoise2
- ankerl::unordered_dense
- CHOC
- cereal
- miniaudio
- AngelScript
- Material Design Icons
- Font Awesome 6
- stb_image.h
- stb_include.h (the vendored version is heavily modified)
- Tony McMapFace LUT
- AgX shader
- Probably several more code snippets that I've forgotten about
No bikeshedding!



