Voxel Raytracer using the new SDL3 GPU API with compute shaders
git clone https://github.com/jsoulier/voxel_raytracer --recurse-submodules
cd voxel_raytracer
mkdir build
cd build
cmake ..
cmake --build . --parallel 8 --config Release
cd bin
./voxel_raytracer.exe
git clone https://github.com/jsoulier/voxel_raytracer --recurse-submodules
cd voxel_raytracer
mkdir build
cd build
cmake .. -DCMAKE_BUILD_TYPE=Release
cmake --build . --parallel 8
cd bin
./voxel_raytracer
Uses a single compute shader here with no acceleration structures (and as such, is pretty slow)
- Start a ray from the camera in world space
- Convert the ray position to local space
- Get the current chunk and position within the that chunk
- Convert the chunk coordinates to chunk data coordinates
- Index the block texture at the chunk data coordinates and position within the chunk
- Calculate the intersection location and apply reflection/refraction a few times
- Accumulate over multiple frames