Hello,
I have implemented dual contouring based on various info I found online and also implemented it with the Jobs and BurstCompile systems. It seems to work really well.
I just have one question in regards to the actual editing of the terrain. How would you go about removing/adding primitive shapes to the terrain such as cubes/spheres, and how do you manage that data? The initial thought I have is to store the generated density data and modify that data when the player makes a change, but the dual contouring algorithm uses density from inside cells to calculate the zero crossing and normals, so I can’t store the modified density of each coordinate because I wouldn’t be able to calculate the densities inside the cell from it.
I’d appreciate if anyone could give any pointers or help in this. Also, I’d be willing to share my project if anyone is interested, just let me know
Example picture (sphere density function with noise) attached