About

A procedural planet generator done in Unity, exploring compute shaders for parallel computations, and Unity's custom editor features.

Currently, users can specify the size of continents, look and depth of oceans, height and steepness of mountains, as well as the colors to apply to these elements. Planets are generated in-editor, in real-time.

We generate a sphere with uniformly distributed vertices. Layered simplex and ridge noises are then used to create mountains, oceans, and plains. By taking a vertice's normal and distance from the center, we can color the planet based on altitude and steepness. The entire process happens in the editor, using shaders to calculate the various heights and colors in parallel. Utilizing Unity's custom editor feature, I can call to recalculate new planets live, with every change, without ever pressing play.

Context

This was my very first Unity project and came out of wanting to learn both Unity and compute shaders all at once, as quickly as possible. I was heavily inspired by Sebastian Lague's videos on this although the code is all of my own and my implementation pretty heavily differed from his by the end of the project.