Archive · Graduation research
Sphere generation study
Which sphere generation algorithm is the best choice for procedural planets?
- When
- Sep 2021 – Jan 2022
- Tech
- Unity, C#, HLSL
The study
I compared four algorithms: UV sphere, quad sphere, icosphere and Fibonacci sphere. The comparison covered vertex distribution and density, data storage, subdivision control, UV space use and triangle uniformity.
I then took the two most promising candidates and weighed different ways of implementing them. To test them, I built an interactive sphere generation project in Unity that applies textures, noise maps and tuned parameters to generate Earth and Earth-like planets.
Choosing the candidates
A good planet sphere can be split into parts that are handled independently, without adding complexity, and keeps triangle size and vertex spacing even so detail is the same everywhere.
- UV sphere. Easy to generate and unwrap, but vertices bunch up at the poles and thin out at the equator, and it can't be split into independent parts.
- Fibonacci sphere. Can place an exact number of points, one at a time, but has no simple triangulation and can't be split into parts either.
- Icosphere and cube sphere. Both start from a platonic solid, so their faces can be handled independently and points stay evenly spread. These two scored highest and went on to implementation.
Four implementations
- Multi-mesh cube sphere. Six separate meshes, each generated from its own local up vector, with a cube-to-sphere mapping that evens out the denser points near the cube's edges and corners.
- Single-mesh cube sphere. The whole sphere in one mesh, adapted and simplified from Jasper Flick's Rounded Cube tutorial on Catlike Coding.
- Icosphere. Twenty separate meshes subdivided by splitting every edge at its midpoint, based on Andreas Kahler's method.
- Icosphere, alternative method. Each face is filled row by row from an exact number of vertices along its edges, which gives far finer control over how fast the vertex count grows.
All of them needed the same fix: triangles crossing the texture seam had reversed winding in UV space, so they were found and their low-u vertices duplicated on the other side of the map.
From sphere to planet
Compute shaders turn the spheres into planets, so every implementation can be shaped and coloured the same way.
- Earth from data. A height map displaces each vertex, remapped between the Mariana Trench at 11,034 m deep and Mount Everest at 8,849 m high, so terrain can dip below the original radius as well as rise above it. NASA's Blue Marble imagery and GEBCO bathymetry data give a real Earth.
- Procedural planets. Layers of simplex noise build continents, a ridged noise type adds mountain ranges, and later layers can use the first one as a mask so detail stays on land.
- Colour. A second compute shader paints water, beach, grass, mountain and snow into a texture based on each vertex's elevation.


What I found
- The single-mesh cube sphere topped out at 52 subdivisions and 65,105 vertices, because a mesh breaks down past the 16-bit limit of 65,535. It suits distant props.
- The first icosphere hit the same limit at 8 subdivisions, and needs at least level 4 for a round silhouette.
- The second icosphere performed best. Exact control per edge kept it just under the limit, and its twenty separate faces mean unseen parts can be dropped, which makes it the best fit for large planets.
- The multi-mesh cube sphere behaved much like it, but each face has to carry a sixth of the planet unless it's split further.
Next steps would be a level of detail system, splitting meshes past the 65k limit, more noise types, and mesh generation on the GPU.