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
332 stars 43 forks source link

Sphere world generation #11

Closed emre-sahinn closed 2 years ago

emre-sahinn commented 2 years ago

Hi, how can I make spherical world shape? What should I change in marching cube algorithm to make world spherical?

Javier-Garzo commented 2 years ago

For a spherical world shape you will need modify the chunk system to support 3D chunk (now only have infinite X and Z) and the noise manager to generate 3D spheres (the planets). Another possible solution is the modify the chunk system to generate a close 3D environment (the planet surface) and when the user leave the planet show a 3D planet generated with other system ( Example Sebastian Lague)

Maybe the first one will need a lot of optimization if the planet is a big one because the mesh calculations, the second option is more efficient friendly

emre-sahinn commented 2 years ago

Thanks! Seems like a lot of work but i will go with the first option because it will be a multplayer game which players can dig through world :')