DEV Community πŸ‘©β€πŸ’»πŸ‘¨β€πŸ’»

Alexie "Mega"
Alexie "Mega"

Posted on

HSEG Devlog 2

And so, I began work on creating a planet generator.
At this stage, I've essentially just been following Sebastian Lague's procedural planet generator tutorial on YouTube. This was good and bad in a few respects. For instance, I was essentially just copying code into Unity, not learning the basics of how to use C# or really even just Unity for that matter. I did however learn a lot about noisemaps and terrain generation and should be able to do it myself once I properly understand the language.

The following screenshots, originally posted as comments on their relative GitHub commits, show the progression of the planet generator:

It all starts with a cube.
It becomes stretched out into a sphere, and they can have different resolutions.
A higher resolution means more triangles per side, higher resolutions mean more mesh detail.

Then, colors and sizes were added.
A yellowish planet.
A purple planet.
The same purple planet, but larger.

Then began work on the actual noisemaps and terrain generation.
Normal sphere with no noise.
Noise applied to the sphere.
Created variables which allow you to change the noisemap, thus editing the shape of the planet.
Same case, cool shape.
Created the ability to use multiple layers of noise and some extra settings.
Added a "minimum noise" option to create oceans.
Same case, but continents instead of mountains.
Added the ability to use another form of noise layers, the previous now being sub-layers. This allows you to mix different types of terrain, i.e. continents with mountains.

And then, filters to put on noise layers, for even more specific terrain.
Created a new noisefilter to make ridgelike terrain.
More detailed version of last image.
Same case, but with the normal continent layer enabled.
Made a simple way to create new noiselayers. Noiselayers also now able to have special settings that only apply to them.
Added a way to only render one face of the cube-sphere, to reduce lag when rendering high resolution planets.

From there, I could start on shaders.
Shaders set up, not properly rendered.
Shaders properly rendered.
Added an editable color gradient to change the color of terrain based on the height.

Then, biomes.
Grassy, to sandy, to icy. The biomes use their own noisemaps to make them more natural, and blend together.
Accidentally made this.

And that's that. The planet generator code was done, I had nothing left to do with it, and it was good.
But there was one big problem...

Top comments (0)

🌚 Browsing with dark mode makes you a better developer.

It's a scientific fact.