norman784 / gaiku

3d agnostic framework (game engine) terrain engine
40 stars 1 forks source link

Research and Propsals for Comments #46

Open QuantumEntangledAndy opened 3 years ago

QuantumEntangledAndy commented 3 years ago

Hello again.

I have been getting back into my volume based rendering in rust and wanted to discuss some of the research with you.


Bakers

I have been looking at other surfacing algorithms and some of which I think we can implement into the bakers.

Links:

Chunk Trees

With regards to a tree structure to hold chunks the most interesting one I've seen is this one by voxel gfx it holds the chunks in an octtree where each level represents higher detail. This has the nice benefit of allowing LODS to page in and out

On a more general structure I think we could use a method like dual grid to help work out the neighbors in a chunk tree

Density

Currently the chunks are all integer values on a grid. But it might be more useful to represent them as densities on a grid. There are a few benefits to this:

norman784 commented 3 years ago

Bakers

I need to read the links that you send me, but some things will be easier to implement right now, like the marching tetrahedra and dual marching cubes, there are also other bakers I wanted to implement (dual contouring, surface nets, etc).

Chunk Trees

The chunk trees it looks interesting, need to check out, but a quick glance at the links seems to be pretty solid.

Density

I need read more about this topic, because I'm not sure if I understand this correctly, isn't this something similar to the heightmap?

QuantumEntangledAndy commented 3 years ago

Density is in 3 dimensions. Well any number of dimensions really. Currently we just have 0 outside 1 inside. But with density you can think of it as a float of deepness into the surface. Read up on the other pages on the voxel gfx page and it goes into the details.

I'm currently working on the chunktree and the density. Chunk tree is almost there and I have a working density but needs refinement.

QuantumEntangledAndy commented 3 years ago

To do dual contoring and surface nets We will need to swap to a density model (because of the gradient requirement).

The current binary model is a subset of a density model.

I think the way forward might be more breaking changes so that we work in density with the binary model being a special case of the density.

QuantumEntangledAndy commented 3 years ago

So I have been having fun with the chunktree with LODs and this is how it is currently looking:

https://user-images.githubusercontent.com/13386481/120269646-65b1bd80-c2d2-11eb-9557-371652707056.mp4](https://user-images.githubusercontent.com/13386481/120269646-65b1bd80-c2d2-11eb-9557-371652707056.mp4

QuantumEntangledAndy commented 3 years ago

Check out my LODTree branch to see the code https://github.com/QuantumEntangledAndy/gaiku/tree/LODTree

QuantumEntangledAndy commented 3 years ago

I have been trying to work up some density based changes. I'd like to do it in such a way that we can reuse the same density code for the discrete (u8) case too.

What I would like is for the density to work like this.

This will make the code for the LOD tree simplier and allow large structures to break up easily into smaller chunks.

The interpolation should also smooth the structure a bit.

I am debating how to specify the sub range c-d should that be in the BakerOption and how the a-b domain could be specified maybe in a trait for the chunk. Only we have a lot of seperate traits now and it would add another trait bound to the Baker one that is not always needed which I think rust won't allow. So maybe a seperate function in the baker. Maybe bake_range. I am starting to feel like there are too many traits to maintain 555.