terrain_lod
Determines the levels of detail (LOD) and cache behavior of chunked terrain. The terrain cache swaps terrain to and from video memory and reduces the memory requirement for huge terrains. LOD levels render terrain chunks in reduced resolution dependent on their distances to the camera, and thus increase the frame rate for huge terrains.
Range:
0 = Disable terrain cache and LOD (default).
1 = Enable terrain cache, disable LOD.
2..4 = Enable terrain cache with 2..4 LOD levels.
Type:
var
Remarks:
- This variable must be set before loading the terrain, and affects chunked terrain only.
- Only OBB collision detection works with the terrain cache. AABB collision detection requires uncached terrain.
- When LOD is activated, chunk sizes are automatically set to a multiple of 8. If the number of terrain mesh squares is not a multiple of 8 in any direction, unchunked stripes remain. For this reason the number of terrain mesh squares should be a multiple of 8 (i.e. 8*n+1 vertices in x and y direction).
- LOD levels are automatically generated when loading the terrain; every level has half the resolution of the previous level. The seams between chunks of different resolution are patched with connecting polygons. LOD levels can be observed by pressing [F11] twice.
Edition
A7.10 P
Example:
terrain_lod = 4; // enable terrain LOD
terrain_chunk = 40;
level_load("myterrain.hmp");
See also:
Terrain, terrain_chunk, detail_size ► latest version online