We now have a 50x50 heightmap of the world. This article explains how to generate a 5000x5000 detailed heightmap from it.
First of all, I don't store the whole map in memory but only the player current 100x100 region and the 8 surrounding regions. Each 100x100 region correspond to a single pixel in the minimap.
The first thing is to read the height of the 9 regions (current + 8 surrounding) in the minimap. From those 9 values, we will interpolate the values for the 100x100 cells of the current region (the one with the white border).
We start the generation one quarter after another. Let's see the first (north-west) quarter :
We can now focus on only 4 regions. We already know that the bottom right corner of the quarter has the height of the current region (h). We need to interpolate the height of all other cells from the four values hNW, hN, hW and h.
We calculate first the height hTop and hBottom :
hTop = hNW + (hN - hNW) * (0.5 + x)
hBottom = hW + (h - hW) * (0.5 + x)
Then we interpolate between those values with the y coordinate :
h(x,y) = hTop + (hBottom - hTop) * (0.5 + y)
Now we have our 5000x5000 map interpolated from the minimap, but it's still flat. We just have to add a random noise (another fbm) to add realism to it.


