Friday 21 March 2014

Procedural Forest Generation with STRM height data

For animations to model development projects in the real world, I have worked on integrating a multi-textured forest system with a map editor which takes a height map as input for the terrain height values.


First I use the SRTM elevation database to generate a height map image of an area.  This image is easy to match up with other maps as overlays, which can be used to find features and as references for a map editor.






A method was added to my generic map editor, which automatically determines forest type depending on elevation.

This method is based off of the relative height values of the input height map, which blends texture weights for elevations.  This basic implementation ranges from rock out crops (above timber line) to thin forest, to dense forest, and mixed deciduous and pine at lower elevations.


After loading this map into a scene program, complete with depth effects, map elements etc, it is easy to see the overall effect of a dynamically created forest based on terrain features.  Though in this preview it is still easy to see grid lines of the forest textures.  This can be minimalized by randomizing forest values, such as randomizing thin forest values. 




Finally, I have an animation system so I can record values for different layers in real time, (such as camera motion, icon opacity etc.) to make refined compositions to show various interactions with the forest system.