Javier-Garzo / Marching-cubes-on-Unity-3D

Terrain voxel engine with the use of Marching Cubes implemented in Unity 2020.3.17f1 (LTS).
MIT License
334 stars 43 forks source link

Questions #7

Closed GodOfMemes closed 2 years ago

GodOfMemes commented 2 years ago

I have two questions.

  1. How and where can I add the code to smooth the terrain.
  2. Does this support underground generation for example ores.
Javier-Garzo commented 2 years ago

1.For the first question with the current code (Marching Cubes algorithm) you always will get some voxel style, the "interpoalte" variable inside MeshBuilderManager gameobject can smooth the terrain a little but not create a full organic terrain. Tocreate a full organic terrain you can upgrade the Marching Cubes with Dual Contouring, in this serie of videos you can see that he upgrade the Marching Cubes with Dual Contouring and he obtain a organic terrain.

2.The terrain now only supports different layers of terrain that chage with the depth from suface. You can modify the current code to generate ores, but a better solution si to use a 3D noise to generate cave systems and ores.