In this project I developed a C++/OpenGL/GLSL API to create, modify, iterate, defragment and render (rasterizing or raytracing) GPU octrees in realtime. GPU octrees were stored as a 3D texture in GPU, and the operations were done using computation shaders.
It supports rendering them by rasterization and by raytracing, both in real time (~60 FPS in full screen). The whole cube you see in the video is a single octree.
I learned a lot in this project. It was super fun because I had to design the optimal octree node format to minimize the GPU memory bandwidth, so that it was as fast as possible, and I had to do a lot of bit fiddling, which was very entertaining! Each octree node was fit into a 32 bits int. I learned many things about compute shaders, 3D textures and GPU optimization.
Source code is on github: https://github.com/sephirot47/Sandbox