0

I want to use octree to save space, because I have a bunch of 3d arrays with a lot of same data (voxel chunks where blocks just uint16). I've seen implementations of octrees for ray traversal or space partitioning but all of them contain octree center and node size, I do not need any of that, I want only compressed data storage. I'm currently looking into Morton codes, but I'm not even sure if this is the right thing to do.

  • in memory, for disk i'm planing to combine multple chunks into "big chunk" and lz compress it. – Mark Nefedov May 18 '20 at 13:55
  • For the top level of the octree you store 8 elements; each is either a value (if the entire octant is occupied by that value) or a pointer to another 8 elements, each is either a value (if the entire octant is occupied by that value) or a pointer to another 8 elements, ... well, you get my drift. The octree *is* compressed data storage for 3d arrays of values – High Performance Mark May 19 '20 at 10:51
  • I understand that, i can't figure out how can i make interface to access octree nodes like 3d array. value = get (x, y, z), returns value closest of leaf node. – Mark Nefedov May 19 '20 at 18:49

1 Answers1

1

I made what i wanted, size can be computed from amount of splits. https://github.com/markusgod/cubic-octree