For my 3rd year module ‘Procedural Methods’ I experimented with a couple of different procedural terrain generation techniques.
The first technique I used was mid-point displacement – using an algorithm called the ‘Diamond Square’ algorithm. This algorithm goes through a number of different steps and repeats itself until the terrain is fully generated. For more information on the diamond square algorithm click this link.
The initial terrain looks like this:
Just now the terrain is far too large, the texture is stretched and the cliffs are far too pointy. To smooth out the terrain I created a simple noise map which is then blurred and multiplied with the terrain map.
After smoothing the terrain looks something like this:
Finally, to make the terrain look more realistic and less 2-dimensional I added snow to the mountain using slope-based texturing. The implementation of this sounds complicated but in reality its quite simple.
First I created a normal map for the mountain by taking the tangent vector of each point in the height map. From there all I needed to do was calculate the slope by using the formula (1 – normalmap.Y). This will give us the slope of each point – the steeper the slope, the less snow there will be.
After adding the texture, the terrain looks like this: