Terrain Generation part 2: layering noise functions

Where the last blog post left off was the idea of a cylinder world map having encirciling seas at both the north and south pole.

Stage 4: Softing the encircling sea falloff.

The falloff scale of the encircling sea was on the scale of [0.0,1.0]. I’ve rescaled that to [0.5,1.0]. Further, the abrupt cliff where a scale can go from [0.5,1.0] next is very harsh. A naive blurring effect tones it down a little.

Stage 3 blurred falloff

Stage 5: Billowy Perlin noise for terrain

Because Rust noise has such a convenient package, using that to create some terrain ridges seems easy to try next.

ScalePoint::new(Billow::<Perlin>::new(20).set_lacunarity(3.0)).set_scale(3.0);

Billowing Perlin noise

That’s interesting height map, so if I then convert anything lower than 160 on the grey scale to water, that looks like this.

let pixel = (noise * 255.0).clamp(0.0, 255.0) as u8;

if pixel < 160 {
    img.put_pixel(w, h, image::Rgb([0, 0, 255 - pixel]));
} else {
    img.put_pixel(w, h, image::Rgb([30, pixel, 30]));
}

Terrain from billowing perlin noise

That’s really not bad at all, but it’s not paying attention to my intention for encircling seas.

Multiplying my encircling seas heightmap by the terrain heightmap brings it around to this on greyscale and then also the same terrain function.

Grey scale layered functions

Terrain scale layered functions

That’s a really harsh falloff and looks very jagged. Very apparent on a southern island.

Terrain cropped and zoomed

Going back to the top, combining with blurred regions brings out this.

Blurred and layered gray scale terrain

Blurred and layered terrain

Picking out the same island again, that jagged pixelated coastline looks much better.

Smooth coastline

Where next time?

If there’s another blog post, going to do a better job of continent creation.