MSTBH Map Generator

Started: 2013/03/04
Genre: Terrain Generator
Language: C++, C#
Members: Andreas Reich
Johannes Jendersie

The Minimal Spanning Tree Based Height Map Generator is a collection of experiments with the aim to create realistic appearing landscapes. One part of the project is a C++ library which generates a height map and the second part is a gui with a map preview. The whole preview (2D + 3D Map + Sky) is just one single pixel shader. No part of the project ever renders geometry.

Many common terrain generators use a value noise (1/f fractal noise) with extra parametrizations or try to apply erosion on such a noise. Using a value noise as a height map is already a sufficient for many maps, but always looks like clouds. So the terrains have a height self similarity and smoothness which lacks reality.
The basic idea to improve such noises is to use a distance field to create mountain chains. A common choice is the usage of a Voronoi diagram or better to say the distance field from that diagram. If the Voronoi diagram is created from a point set the result is a so called Worley noise.
It is also possible to compute a distance function to an arbitrary shape which leads us to the Minimal Spanning Tree (MST). I observed that such a graph structure is very similar to ridges on real mountains. The idea is to use a point set which can be interactively changed to model a realistic looking landscape.MSTDistanceField

Now it would appear natural if we can take the vertices of the graph and move them to model a terrain. Since it is more intuitive to edit mountains instead of valleys the generator can be used inverse to create the inverse distance function f(x,y) = -d(x,y).

Currently the tool allows for layered editing of a terrain with different blending techniques in the layer stack. Just adding one simple noise to the MST produces the following:


More detailed technical explanations can be found in the following posts:

Final feature list + Download

Leave a Reply

Your email address will not be published. Required fields are marked *