Creating Procedural Planets in Unity — Part 1

Peter Winslow
8 min readSep 17, 2017

Several years ago, I started working on the Poly Universe project — an experiment to procedurally generate low-poly planets. That experiment has gradually grown into a full-fledged civilization building game set in a universe of tiny worlds, which look a bit like this:

It’s no fun keeping this to myself, though, so I’m starting this tutorial series to share what I’ve learned with the rest of the gamedev community. The code I’m going to be sharing is written for Unity, using C#, but the techniques should be portable to any engine which allows you to generate meshes on the fly. And half of it is really just math, which should be valid for anyone who inhabits euclidean space. =)

I’ve also written a working example project that covers what’s happening in this tutorial! You can download it here on GitHub. Hope you find it helpful!

Step 1 — Generating a sphere.

The first step in procedurally generating a planet will be to create a round ball that we can mold into the shape of a planet. There are (at least) two good ways of going about doing this, and each one has its own advantage:

Creating a round ball, either by subdividing an icosahedron, or a square.

--

--