The vertices in these patches are uniformly spaced because we not only have to generate patches to render, but potentially separate patches to form physics meshes. We have a very efficient pipeline for requesting and generating these uniform patches to ensure that there is always a physics patch available for any player or non-player entity that requires it.

Planets tend to be a little curvier than cubes though. Using compute shaders on your GPU, the patches undergo spherification via a mathematical function and they are subject to noise graphs. These are collections of noise equations which take the points position and unique planet ID as input information, along with the astronomical data mentioned above, to form geological feature shapes which can span the entire planet surface if needed.

In terms of scope and scale, though, planet-scaling noise across accurately sized planets is a challenge. To ensure consistent visuals and gameplay on the screen and between users we need millimeter precision, but the input values for the noise functions depend on the point on the surface of the world relative to the planet’s center, which can be of the scale of tens of billions of millimeters. We could use 32 bit – i.e. single-floats if the scales involved were 100s of km instead of 10s of thousands of km. To tackle this, we have written alternate libraries to create the functions in 64 bit – i.e. double precision and dual-float precision. The former is native 64-bit handling floating point numbers and the latter is emulated 64-bit functionality using two 32 bit floats. The reason for this is some GPUs handle one better than the other, or not at all, and we need good graphics card coverage. This comfortably gives us the number-space required for millimeter precision.

Painting Planets

When Horizons originally launched we used entirely computer simulated planets. Rock and dust surfaces were entirely described mathematically using pseudo-random number generation. In an update, artist-generated textures were introduced for rock, sand, and scree per material on a planet, blending depending on the gradient of the terrain. Wang-tiling was used to break up the pattern of the texture. Tri-planar blending is also utilized to make sure no stretching happened to the textures across the curved 3-D surface of the entire planet. For most hardware, using blended artist textures driven by the simulated masks based on the terrain performed fastest and looked the best.