Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines
(1 edit)

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.

Hmm so its just an octree, with more children per leaf? what's the depth?

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.

Yes, it's just a octree with more children per node.

Fascinating, So did you come up with the name "tetrahexaoctree"?

No, I did not.

Here's an animated gif showing a scene with and without tetrahexacontree wireframe display (click image to see large version) :


Right... your raymarching right? can you give me a brief explanation of how you've implemented that?

Yes, I am using ray marching for voxel rendering.  My engine also supports rendering lines and triangles (meshes) via rasterization.

I'll have to write up an outline of how I'm doing the ray marching.  It's going to be a quite long outline...  I'll have to get back to you on this.

Thanks!

Any updates? (on raymarching)

I'm still struggling with trying to put the GLSL code into an outline description that makes sense (isn't too abstract).

Don't worry about it being to abstract. I know a little GLSL and a little raymarching. and a little bit about octrees.

Here's the algorithm I'm using:
Pastebin -- Tetrahexacontree Voxel Volume Raymarching

Thanks, I'm still reading through it, its complicated and a little confusing.

Are you using sdf raymarching?

I finally got my own voxel engine started :D thanks for your help so far, one day maybe it will be as good as yours.image.png

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

Yes Douglas's videos are very impressive. mipmaps? I haven't heard much about those. care to tell me more?

Wikipedia on Mipmap: https://en.wikipedia.org/wiki/Mipmap

I'm using 3D mipmaps of voxel volumes to improve performance and visual quality of volumes that are farther away as part of the level of detail system in my voxel engine.

This video shows them (color coded for testing) in action:

Wow, so its like LOD for raytracing/raymarching?