Skip to content

This is an older version of a procedural planet generation. The project is no longer worked on. Feel free to use the code for your project, but no bugs of fix will be updated.

License

Notifications You must be signed in to change notification settings

TheHunterJPScripts/Procedural-planet-generation

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 

Repository files navigation

status

New feature added:

Now the planet have water and can be populate:

Procedural-planet-generation (Unity Project)

Generate planets proceduraly. (Generate)

Low Poly style:

Terrace style:

How to use?

We only need to import 5 files:

'Planet.cs' , 'PlanetData.cs' , 'Polygon.cs' , 'ColorHeight.cs' , 'GenerationData.cs'.

GenerationData:

This scriptable object stores the information that will then be used to get the height of the map vertices (it uses perlin noise).

PlanetData:

This scriptable object stores the information that will then be used to create a planet.

Generate the planets:

To add a planet to the list of planets that will be created, use the functtion:

Planet.AddPlanetToQueu();

To start the thread that will calculate the data for the mesh sphere generation and modification of the landscape (will only be executed after StartDataQueu has ended):

Planet.StartDataQueu();

Instantiate the planet into the scene:

Planet.InstantiateIntoWorld();

Wait until the planet data have been compute. Then load the chunks in range to the position.

Planet.HideAndShow(Vector3 position);

Both InstantiateIntoWorld and HideAndShow can be used at the same time. In that case InstantiateIntoWorld will generate the planet until it's fully generated and the will hide all the terrain that is not in range of the position.

The end result should look like this:

About

This is an older version of a procedural planet generation. The project is no longer worked on. Feel free to use the code for your project, but no bugs of fix will be updated.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages