I implemented bilinear interpolated white noise in order to procedurally generate terrain.
I can obtain this kind of result:
I would like to implement ridged fractal noise to get a more realistic terrain like:
However I can't find a good tutorial for ridged fractal noise. Can you explain to me how to do this?
Ridged perlin noise is actually fairly easy to do - you just have to ABS() either the final heightmap or some subset of the noise layers (and then invert the resulting height map values, to make sure the ridge occurs at the high values).
Example: (basic perlin noise with trilinear interpolation followed by ABS and INVERT of the entire height field). (INVERT means "multiply by -1".)
I highly recommend experimenting with various configurations of fractal noise layers and basic mathematical/logical operations.
Another example: (two different low frequency perlin noise layers merged using a logical INTERSECTION / math MINIMUM function)
However, no simple modification to a fractal noise algorithm will give you those details that appear to "flow downhill" (and make the terrain much more realistic and appealing). To achieve those, you will need to add some kind of erosion simulation, which is a much more complex beast (both algorithm-wise and CPU-wise).
For some information on that, I recommend these two papers (you can ignore the GPU part, the algorithms work fine on CPU, although in my experience the simulation will take a minute or so for a 1000x1000 px image):
EDIT:
Let's clarify what I mean by "apply ABS on the height field".
You simply grab numeric value of height in each pixel of the map and apply the ABS () function on it, discarding its sign.
That assumes that the perlin noise generator generates the values in range <-1,1> (or another range centered on 0). ~50% of the pixels are expected to have value greater than 0 and ~50% are expected to have value less than 0.
The ABS causes sharp ridges to be created where the 0 is, since all the bilinear/trilinear interpolation would make sure that there used to be a smooth slope passing through the 0 value.
Consider this image:
It shows two COS(x) functions, one of which was modulated with an ABS function (I have added a small offset to make sure both lines are visible separately). Now imagine that the purple line is flipped vertically - you end up with two mountains with sharp ridges and a valley in between:)