20
\$\begingroup\$

How do I turn Simplex noise like:

enter image description here

into something like:

enter image description here

or

enter image description here

The noise has too many white spots and varies too much to represent things like continents. Where it's water, water, water, and then land with cut out edges.

\$\endgroup\$

2 Answers 2

32
\$\begingroup\$

It looks like you're looking for "Turbulence", "Fractional Brownian Motion", or something similar.

This is where we take multiple samples of the noise at different scales - like the different panes in your first image - and add them together.

Each noise sample is commonly called an "octave". For each octave we add, we sample at a higher frequency (so the noise gets denser), but we also scale its output to a smaller amplitude (so the noise gets fainter).

So we might sample the lowest octave (one big white blob) with amplitude 1, then the next octave at amplitude 1/2, then the next at amplitude 1/4...

This gives large variation over long scales (the difference between continent and ocean), with each added octave having a more and more gentle influence, shaping the highs and lows and adding more variation to the coastline in-between.

Here are the 8 panes of noise from your image at the top, averaged together with the weight reduced by about half at each octave:

Noise octaves layered together

Note how we get a cloudy-looking noise, with feature variation at all scales. There are global highs and lows created by the low octaves (the bright white on the left / dark black along the top and bottom), but also smaller highs and lows everywhere in-between. This gives the noise a fractal quality similar to real landscapes, where the closer you look, you keep finding more detail.

Now if we just colourize this map, drawing the dark greys as blues, and the lighter greys as sandy/leafy/rocky, we get something that begins to look like continents!

Same noise, colourized to look like a map

One thing to watch out for: usually we'll want to de-correlate the noise we use at each octave, by changing the hash function or applying a spatial offset. That way you avoid artifacts from repeated features in the vicinity of the origin (which doesn't automatically change as we increase our frequency scale)

You can play with how you generate and scale your noise at each octave to get different effects - taking the absolute value to get "ridge noise" for mountain spines, squaring the noise to change its distribution, etc. There are lots of great articles with different suggestions about how to craft your noise for just the right kind of terrain.

\$\endgroup\$
3
  • 2
    \$\begingroup\$ This article is also very good: developer.nvidia.com/gpugems/GPUGems3/gpugems3_ch01.html \$\endgroup\$ Oct 20, 2019 at 18:10
  • \$\begingroup\$ To add in another example: github.com/bravoserver/bravo/blob/master/bravo/plugins/… contains generators designed to produce Minecraft-like geometry, and was designed for readability. It directly shows how to use simplex noise, as well as noise-derived effects like octaves and differences, to build out a world in layers. An important lesson is that all of this is tuned to please the eye. \$\endgroup\$
    – Corbin
    Oct 21, 2019 at 18:49
  • \$\begingroup\$ Here is an interactive GLSL shader demo of Simplex Noise shadertoy.com/view/MslBzf with the accompanying source that can be modified in real-time (to change colors and levels in which the colors take effect) \$\endgroup\$
    – ssell
    Oct 21, 2019 at 21:32
10
\$\begingroup\$

Not with noise alone.

The other answer is correct, you overlay several octaves of noise to get a realistic structure. But you need to bring in physics as well or it won't be a result resembling reality.

The first approach is to add an erosion model. There's a lot of good sources for how to do that available. This will create ridges and channels in your mountains and get rid of the ten thousand tiny islands problem.

The second approach is to more straighforward modulate the results. Run a calculation of land size just above the waterline and remove small islands.

If your goal is realistic continents, you can also go away from noise and use plate tectonics, like here: http://davidson16807.github.io/tectonics.js/

\$\endgroup\$
7
  • 7
    \$\begingroup\$ The "ten thousand tiny islands" effect is indeed rather unrealistic. :) \$\endgroup\$ Oct 21, 2019 at 19:48
  • 3
    \$\begingroup\$ They exist in specific places, but not all over the map. \$\endgroup\$
    – Tom
    Oct 21, 2019 at 20:53
  • \$\begingroup\$ How would one go about "removing small islands"?? \$\endgroup\$ Oct 22, 2019 at 7:48
  • \$\begingroup\$ @htmlcoderexe - a simple approach would be to measure their size (# of pixels or area for polygons) and delete them if a chance less than X - or probabilistic, the smaller the higher the chance that the ocean swallowed it. \$\endgroup\$
    – Tom
    Oct 22, 2019 at 9:45
  • 1
    \$\begingroup\$ depends on your data structure etc, but most likely, yes. \$\endgroup\$
    – Tom
    Oct 22, 2019 at 10:49

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .