Terrain system rendering
For rendering the terrain system, you have two choices: i) use the built-in terrain rendering system, or ii) render it yourself.
Read time 1 minuteLast updated 2 hours ago
This section outlines how to use the built-in rendering system.
CMyTerrainRenderer
To get started, call during initialization. This function is similar to . The class is derived from and will call internally.
CMyTerrainRender:InitGfx()CMyTerrain::Init()CMyTerrainRenderCMyTerrainEngineCMyTerrainEngine::Init()st_bool CMyTerrainRender::InitGfx(st_int32 nNumLods, st_int32 nMaxTileRes, st_float32 fCellSize);
Descriptions for the function parameters can be found on the Terrain system overview page.
Graphics initialization
Initialize the rendering attributes by calling . It takes an structure that makes some assumptions about how terrain rendering will be done. Modifications will be necessary (and expected) when deviating from the example setup.
CMyTerrainRenderer::SetRenderInfo()STerrainRenderInfoThe example terrain rendering setup used by the reference application assumes that three diffuse textures are used, a splat map, and a normal map. See the example terrain shaders housed in the reference application for details about how these textures are used.