A real-time ray tracing voxel rendering engine.
Note: these recordings are very compressed
ray-tracing-demo.mp4
This is 23^3 top level chunks (of size 64^3), or 2240^3 = 11.2m area
terrain-demo.mp4
lod-demo.mp4
Rust: https://rustup.rs/ Vulkan: https://github.com/vulkano-rs/vulkano/blob/master/README.md#setup-and-troubleshooting
To run: cd example_game ; cargo run
see WALKTHROUGH.md
Uses custom ray tracing in a compute shader (i.e., does not use hardware ray tracing) (see shaders/raytrace.comp)
There is a list of voxel type definitions that can easily be modified in Rust that define how each voxel looks (material properties, whether it emits light, etc.).
Voxels are stored densely on the GPU (no sparse data structures, no meshing) in two formats:
- A bitmap (0 for air, 1 for filled in)
- A list of IDs (which are u8s) representing which voxel type is present in each spot
There is a level of detail (LOD) system where unit voxels in further away chunks are combined together and rendered as larger voxels.
A chunk loading system runs in parallel with main thread execution and allows you to define your own generation and persisting of chunks.
See walkthrough for more details.
- Relies on storing all voxel data densely in GPU memory (no meshing, sparse data structures, etc.)
- Currently, lots of the parameters that can be freely changed in the Rust/CPU code are hardcoded in the GLSL/shader code. You will need to change both if you do something different from example_game.