glscene

 

TGLTerrainRenderer

Page history last edited by skinhat 4 yrs ago

The terrain renderer is used to create terrain using the most advanced terrain generation algorithm available (ROAM). The terrain renderer uses a height data source to generate the terrain heights. Height can be specified as a grey scale bitmap with the TGLBitmapHDS (where white is the highest peak while black is the lowest) or HTF file format. A texture can be applied to the mesh giving a realistic terrain.

Important terrain renderer parameters include:

clodprecision: Defines how accurately the terrain is generated. The lower the clodprecision the higher the accuracy and the slower the terrain generation.

tilesize: A terrain can be split up into tiles. Tiles that are far away from the camera a displayed with lower precision than those closer to the camera, therefore having more than one tile is desirable for speed.

tilespertexture: This defines how a texture is displayed on the terrain. If there are multiple tiles then you will need to increase the number of tilespertexture in order that a texture covers the entire terrain.

heightdatasource: This set the height datasource. The most commonly used one is the TGLBitmapHDS. Others include the TGLCustomHDS, TGLHTFHDS (for HTF files) and TGLPerlinHDS (for Perlin noise generated terrains).

An 'interesting' feature of the terrain renderer is that the texture is displayed the wrong way round therefore you will need to mirror the texture if you want the texture to be the correct way round.

Note also that Phil Scadden has written an article about the terrain renderer with much more detail at:Terrain Renderer

Demo: CVS/Demos/meshes/terrain

Unit: GLTerrainRenderer

Descends from TGLSceneObject.

Comments (0)

You don't have permission to comment on this page.