aldus.nexus

Planet forge

Seeded procedural planets built from layers of noise: oceans, mountains, clouds and rings.

Orrery
In the dish

Noise layers

Each octave adds noise at twice the frequency and half the strength. Left to right, the octaves build up into the height map; then the warp, moisture and clouds layers. Light is high.

The numbers

height of the surfaceshare of area, sea level dashed
biomesshare of the surface
octave weightsgainᵏ, normalised

How it works

The planet is a sphere of numbers. Every point on it gets a height from layered noise, then a biome from its height, latitude and moisture, then light from the sun. Point at the planet and each step below fills in the numbers for the point at the centre of the disc. The How it works guide has the short version.

1A seed for a world

The seed text is hashed (FNV-1a) into a 32-bit number, which shuffles the permutation table inside the noise and picks the world's defaults: its kind, sea level, roughness, rings and moons. The same seed always forges the same planet, on any computer, so a seed is a whole world in a few letters.

Every project on this site is a world too: on the home page orrery each one is a tiny planet seeded by its address name, its kind picked from its colour (red lava, orange and yellow arid, green terran, blue ocean, indigo ice, violet alien). Pick one under site world to see it full size, then Visit to land on the project.

h ← (h ⊕ byte) × 16777619FNV-1a over the seed's characters, from h = 2166136261seed … → …

2Noise on a sphere

Simplex noise gives a smooth random value at any point in space: it sums a few gradient bumps from the corners of the tetrahedron the point falls in. Sampling it at points on the unit sphere, rather than on a flat map, means the world has no seam at the date line and no pinch at the poles.

p = (cos φ cos λ, sin φ, cos φ sin λ)latitude φ, longitude λ on the unit sphereφ = …, λ = …

n(p) = 32 Σcorners max(0, 0.6 − |d|²)⁴ (g · d)simplex noise: d from each corner, g its gradientn(f·p) = …

3Fractal Brownian motion

One layer of noise is blobby. Adding octaves, each at twice the frequency (the lacunarity) and a fraction of the strength (the gain), gives continents with coastlines that stay detailed as you look closer: the same idea of detail at every scale as the fractal explorer, in a rougher, random form. The gain is the rough slider; the noise layers strip above shows the sum building up.

fbm(p) = Σk=0K−1 gᵏ n(2ᵏ f p) / Σ gᵏK octaves, gain g, base frequency f = 1.6g = …, K = …


          

4Domain warping

Before the fBm is read, the point is pushed along a second, slower noise field. Straight noise looks like clouds; warped noise smears into swirls, folded mountain belts and long peninsulas. The warp slider sets how far the point moves.

q = p + w · (fbm₁(p), fbm₂(p), fbm₃(p)), h = ½ + 0.78 · fbm(q)three independent noise fields push the point, w = 0.45 × warp|q − p| = …, height h = …

5Sea level and biomes

Anything below the sea level is ocean, shading from shallows to deep water. On land, temperature falls with latitude and with height, a second noise field gives moisture, and a small table turns the two into desert, grassland, forest, jungle, tundra or taiga, with rock and snow on the peaks. Where the temperature drops below the ice line, sea and land freeze into the caps. Live sky shows the real planets tonight, if this makes you want to look up.

Marks paints the land with the chemistry from reaction-diffusion nebulas: two chemicals on a small map of the globe, fed and drained at one of that page's preset rates for a couple of thousand steps, grow spots, stripes or coral, which then darken the ground (or glow like lava veins on dark rock). In the dish opens the same preset and seed there. The moons ride simple circles; for orbits that pull on each other, try n-body.

T = cos φ − 0.05 + 0.12 nT(2p) − 0.6 · max(0, (h − s) / (1 − s))s: sea level; air cools with heightT = …, moisture …

T < 0.12 + 0.55 · ice ⇒ icethe ice lineice line … → …

6Sunlight, sea glint and air

Each point is lit by the angle between its normal and the sun (Lambert's cosine law), with a soft band at the terminator and a little ambient light on the night side. Water adds a Blinn-Phong highlight, the glint of the sun on the sea. Clouds float on a second texture that drifts a little faster than the ground, and the atmosphere brightens towards the edge of the disc, where you look through more air.

I = ka + kd max(0, n · L) + ks (n · H)⁴⁸H = (L + V) / |L + V|, V towards youn · L = …, glint …

glow = (1 − nz)²·² · max(0, n · L + 0.25)atmosphere towards the limb…

7From the screen to the sphere

For each pixel of the disc, z = √(1 − x² − y²) gives the point on the front of the sphere. Undoing the axial tilt and the view's incline gives its latitude and longitude, so the textures are read straight from the equirectangular maps. Everything except the spin is worked out once, so each frame is one cheap loop; the noise itself is computed once in a Web Worker. The generator is a pure module: seed and parameters in, a colour for any latitude and longitude out, like the maths art page turning a word into a picture.

φ = asin(y′), λ = atan2(z′, x′) + 2π · spin(x′, y′, z′): the pixel's normal turned into the planet's frame…

texture: …equirectangular, rows from pole to pole