User Tools

Site Tools

Terrain System

The reference application contains an example helper class used to populate the terrain with data. It's not necessarily intended for production use, but it does provide some useful functionality. The CMyTerrainData object, contained in MyTerrainData.h/cpp/inl, reads height maps and normal maps, providing all of the data needed by SpeedTree's terrain engine. Note that you are free to use any method you like to populate the terrain and that CMyTerrainData is completely decoupled and independent from the SDK's terrain system.

The CMyTerrainData class also provides functionality for returning slope values at any point on the terrain which is useful for avoiding placing trees on areas that are too steep, or for providing slope cues that help you know how much to push the tree into the ground.

Look at CMyTerrain::Populate() for an example use of the CMyTerrainData class as well as a fully implemented callback used to populate the terrain in the reference application.