LucioleMaléfique
LucioleMaléfique

Reputation: 770

How to fill gaps between different level of detail in octree-marching cubes algorithm?

I'm trying to implement marching cubes on octrees. Here is a 2D drawing of what I am trying to figure out, it'll be easier to explain:

marching cube - octree

Each node of the octree represent a square in the plane (or cube in space), and stores a value for the potential on which I run the marching cube algorithm.

Now, the octree isn't built on the data set (the potentials in space), but it is built at runtime to give details wherever I want, and branches can be unloaded / loaded to change detail zones (zoom on the model for example)

Each node contains 4 references to children, which are a subdivision of the space of the actual node. (8 in 3D-space)

Now, I would like to use a marching cube algorithm to render my mesh (for example, a sphere) with parts that will be more or less detailed.

It's pretty easy to do the MC algorithm on a node that contains 4 empty children (I'll refer as empty children as child that only have a potential value, but no other children. they are not drawn on the tree, but they are in black on the right drawing) because I already have my potential values in a square (or cube for 3D space) (orange here) and can create a mesh inside (yellow) with one pass of the marching cubes algorithm

Now, my problem is that I can't figure out how to fill the gaps between the so-made meshes.

My thoughts were to recursively call a GenerateMesh() method in the tree, and each children will return to his parent the useful data so that the parent can fill the gaps, and return the new useful values for his own parent, etc...

But I can't figure out how to deal with different level of details (for example, the red cell would have to combine meshes from the top-left cell that is a 2x2 grid, and the top-right cell that is 4x4

I've already searched a lot online, but most of the papers I've read on the subjects explain theory and not how to deal with this.

How could I solve this? Do you have any references to detailed ways of doing it?

Upvotes: 2

Views: 1171

Answers (1)

larsstifi
larsstifi

Reputation: 21

There is the Transvoxel algorithm (https://transvoxel.org/). It's a modified version of the marching cubes algorithm that uses addition lookup tables, to create new so called transvoxels for seamless transisions between different LODs. In its current form though, it only allows for seamless transitions between LOD with double/half resolution, so you would still have to deal with that.

Upvotes: 2

Related Questions