Vulkan Voxel Engine
by Hendrik Sorensen
Vulkan Voxel Engine is a next-generation, real-time voxel world renderer and simulator, built from scratch in C++ and GLSL. Leveraging Vulkan's hardware-accelerated raytracing, it delivers stunning visuals and high performance, featuring a fully procedural, multi-threaded terrain system. This project demonstrates advanced graphics programming, GPU compute, and modern game engine architecture.
8x8x8 grid of 128³ voxel chunks (512 total), dynamically loaded and managed for seamless exploration.
Hardware-accelerated raytracing pipeline for primary and secondary rays, delivering cinematic visuals.
FastNoiseLite-based, multi-threaded terrain generation with rich material assignment (stone, grass, flowers, etc.).
Bit-packed, chunked, and stored as GPU 3D textures for fast access and minimal memory usage.
Custom GLSL march function for LOD-aware, efficient intersection and traversal.
Multi-threaded chunk generation and prioritization based on camera position for smooth streaming.
Chunk recycling, minimal GPU transfers, and LOD-based skipping for high efficiency.
VK_FORMAT_R8_UINT), with a chunk map (VK_FORMAT_R16_UINT).uint8_t (5 bits material, 3 bits LOD/layer).VK_FORMAT_R8_UINT 3D textures.VK_FORMAT_R16_UINT) maps world positions to chunk IDs.VK_KHR_ray_tracing).rgen.glsl, rmiss.glsl).march function in GLSL: steps through the world, using LOD/layer info to skip empty space efficiently.// 5 bits material, 3 bits LOD/layer
#define voxel_mat(voxel) ((voxel) & 0b11111)
#define voxel_base(voxel) (((voxel) & 0b11100000) >> 5)
// Efficiently store and retrieve voxel data
uint8_t voxel = ...;
uint8_t material = voxel_mat(voxel);
uint8_t lod = voxel_base(voxel);
These optimizations allow the engine to render large, detailed voxel worlds in real time, even on consumer hardware.
VoxelEngine directory.sudo make run
The Vulkan Voxel Engine uses a unique multi-pass raytracing approach for real-time rendering and lighting. The process is visualized below, with each step illustrated and explained.
Lighting contributions (dots) being accumulated per voxel
Voxel colors rendered without fog
Final color output with all lighting applied