How do you handle the voxels? chunks? octree's? one giant array? I'm just curious.
P.S. The tree data structure and voxel volumes primarily reside in host RAM (CPU side) where changes are made. The tree data structure and voxel volumes are also maintained / updated in buffers (parallel arrays) on the GPU RAM where the ray marching is done. The tree data structure on both CPU and GPU side consists of an array of tree nodes and an array of voxel volumes with nodes and volumes being indexed by offsets into said arrays (rather than pointers which GLSL does not support).
No need to worry about the pointer thing if the programming language you are using doesn't have them. I'm a C++ programmer, so that's why I mentioned pointer.
Yes, the volumes are stored in an array in (CPU) RAM and are modified by the CPU during volume generation, block add, remove, etc. After the volumes are modified by the CPU, updates are sent to GPU RAM via Vulkan graphics API buffers. (There will be some compute shader updating going on later, but right now it's all done CPU side.)
A tetrahexacontree is like an octree except at each node it subdivides space into 64 children (4x4x4) instead of 8 children (2x2x2) with an octree. The tetrahexacontree I've implemented is a sparse data structure. One can think of it as a squashed octree in that for a given amount of leaf nodes, it has half the depth. Less depth means better performance for ray marching because there is less moving up and down the tree (via a stack). My implementation of the tetrahexacontree has voxel volumes (16x16x16 voxels) for leaf nodes.
With a large scene loaded, I'm seeing a tetrahexacontree depth of four.
Here's a screen shot with tetrahexacontree nodes and volumes shown as wireframe cubes:
The blue lines are a corner of the tetrahexacontree root node, green wireframe cubes are nodes in between the root node and the voxel volumes, and the red wireframe cubes are the voxel volumes.
You're welcome. Keep up the hard work! I say "hard work" because it has been a struggle to get my voxel engine to where it is at now. I'm still struggling with the compute shader stuff in between working on others parts of the code.
I got mipmaps generating via a compute shader but mipmap regeneration for voxel volume updates (adding or removing voxels) still has a bug.
If you haven't done so already, check out Douglas Dwyer's videos about his voxel engine which is farther along than my voxel engine: https://www.youtube.com/@DouglasDwyer/videos