This is a real-time OpenGL Sparse Voxel Oct-tree Raycaster. It makes heavy use of GPU compute, so much so that a GPU temperature indicator was a needed feature. If you can smell solder, or the temperature indicator gets above 80, quit the program immediately (Press ESC).
git clone --recurse-submodules git@github.com:burito/voxel
cd voxel
make -j8 # Build it using 8 threads
voxel.exe # Windows
./voxel # Linux
./voxel.bin # MacOSX version doesn't work
Load a Wavefront model with the "Voxel Load" option, then press C
to regenerate the tree. You can increase or decrease the depth of the tree with B
or V
respectively, after which you'll have to press C
again to see the changes. It only attempts to populate the part of the tree that is visible to the camera.
ESC
- quitsWASD
- move aroundCTRL
- mode downSPACE
- mode up- Holding Right Mouse aims the camera.
F11
- toggle Fullscreen (⌃⌘F on Mac)C
- regenerate the voxel treeV
- decrease the voxel tree depthB
- increase the voxel tree depth
- Install current Nvidia drivers (461.72)
- Install git
- Install msys2-x86_64-20210215.exe
pacman -S mingw-w64-x86_64-gcc mingw-w64-x86_64-imagemagick mingw-w64-x86_64-clang mingw-w64-x86_64-clang-tools-extra mingw-w64-x86_64-glslang make vim man-pages-posix mingw-w64-x86_64-lldb
- Add the following to your path...
C:\msys64\mingw64\bin
C:\msys64\usr\bin
- Install current GPU drivers, compiler, and libraries
add-apt-repository ppa:graphics-drivers/ppa
apt update
apt install nvidia-410 vulkan-utils build-essential clang imagemagick a52 git-core libglu1-mesa-dev libxi-dev ocl-icd-opencl-dev
- Install XCode
- Needs OpenGL 4.3
- Wants 64bit, but it's not needed. Yet.
- You'll need up to date drivers. As of now that means Nvidia 461.72
The Mac version is broken as MacOS does not support OpenGL 4.3.
deps/stb
- Sean Barrettdeps/fast_atof.c
- Tom Van Baakdeps/small-matrix-inverse
- Nis Wegmanndeps/models
- Morgan McGuire's Computer Graphics Archivedeps/*gl*
- GLEW 2.1.0- Add
#define GLEW_STATIC
to the top ofglew.h
- Add
deps/*fontstash*
- Mikko Mononendeps/include/CL/*
- The Khronos Group
This is based loosely on parts of the algorithm outlined by Cyril Crassin in his PhD Thesis. It is not a complete implementation, and diverges from it in a few ways. In other words, don't allow how bad this is to reflect on him.
For everything else, I am to blame.