Terrain: Terrain Entity – Arma Reforger

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Lou Montana moved page Arma Reforger:Terrain: Definitions to Arma Reforger:Terrain: Terrain Entity without leaving a redirect: Better name)
m (Some cleanup)
Line 1: Line 1:
{{TOC|side}}
{{TOC|side}}
TerrainEntity (abbreviated as TE in this document), class {{hl|GenericTerrainEntity}}, is responsible for rendering terrain mesh and its textures.
TerrainEntity (abbreviated as TE in this document), class {{hl|GenericTerrainEntity}}, is responsible for the entire terrain system; rendering terrain mesh and its textures, collision, etc.


Internally, TE is split into blocks and tiles and supports TE supports non-rectangular shapes of terrain as well, by clicking on "="(equal sign) user may set different grid size for X and Z axis.
Internally, TE is split into blocks and tiles and supports TE supports non-rectangular shapes of terrain as well, by clicking on "="(equal sign) user may set different grid size for X and Z axis.
Line 7: Line 7:


{{Feature|informative|Visualization of Blocks & Tiles can be turned on from debug menu (holding {{Controls|Win|Alt}}), Render → Terrain menu → Block's/Tile's bounding boxes.}}
{{Feature|informative|Visualization of Blocks & Tiles can be turned on from debug menu (holding {{Controls|Win|Alt}}), Render → Terrain menu → Block's/Tile's bounding boxes.}}
<!--
TO BE CONFIRMED


{{Feature|important|
{{Feature|important|
Line 13: Line 17:
It is recommended (mandatory!) to place it at the 0,0,0 position!
It is recommended (mandatory!) to place it at the 0,0,0 position!
}}
}}
-->


=== Vertex ===
=== Vertex ===
Line 35: Line 40:
A '''tile''' may consist of 1 up to 32 blocks.
A '''tile''' may consist of 1 up to 32 blocks.


When the camera is close to a tile typically (if provided) terrain texture (satellite imagery), normal map and surface mask (detail surfaces) are being drawn. These textures are mapped per tile.
When the camera is close to a tile typically (if provided) super texture ("satellite texture"), normal map and surface mask (detail surfaces) are being drawn. These textures are mapped per tile.
 
Once the camera is far enough from a tile so only terrain texture + normal map (no detail surfaces) are drawn, the whole tile is rendered as 1 draw call (all blocks are merged to one mesh, blocks doesn't even have to be in the last LOD).
In the case camera is so far away that all blocks are in the last LOD the terrain mesh can be precalculated and does not have to be merged per frame.


=== Terrain Grid Size ===
=== Terrain Grid Size ===

Revision as of 17:25, 20 June 2022

TerrainEntity (abbreviated as TE in this document), class GenericTerrainEntity, is responsible for the entire terrain system; rendering terrain mesh and its textures, collision, etc.

Internally, TE is split into blocks and tiles and supports TE supports non-rectangular shapes of terrain as well, by clicking on "="(equal sign) user may set different grid size for X and Z axis.

A world can have 0 to 1 terrain - multiple terrains (e.g in order to avoid terrain size limitation) is not supported.

Visualization of Blocks & Tiles can be turned on from debug menu (holding ⊞ Win + Alt), Render → Terrain menu → Block's/Tile's bounding boxes.


Vertex

(Plural: vertices)

Block

A block is the smallest part of TE which gets LODed, as opposed to the Real Virtuality engine where terrain LODing was done on tiles level.

1 block = 1 draw call

Even though surface mask (for rendering detail surfaces) is split and mapped per tile, a limit of maximum 5 detail surfaces is being applied to blocks.

Enfusion engine currently supports 5 LODs per block.

Each block consists of 32x32 faces (33x33 vertices) down to 2x2 faces (3x3 vertices)

Tile

A tile may consist of 1 up to 32 blocks.

When the camera is close to a tile typically (if provided) super texture ("satellite texture"), normal map and surface mask (detail surfaces) are being drawn. These textures are mapped per tile.

Terrain Grid Size

Count of terrain faces in rows/columns, remember that 512 faces is 513 vertices, this necessary to keep in mind when importing heightmaps.

Grid Cell Size

Distance between two neighboring terrain vertices. The lower the value, the higher the detail of terrain.

Increasing/decreasing this value affects the final size of terrain.

Terrain Size

The terrain's total size is Terrain Grid Size multiplied by Grid Cell Size.

Heightmap

The terrain's heightmap is internally in 16 bits integer format and the height scale value is the difference between minimum delta, so e.g. difference between 100 and 101 in internal representation is 0.0315 as default. This value shows the maximum possible height of terrain, 0.03125 × 65535 (the 16 bit value) = ~2048 meters range.

Changing this value affects elevation range (the vertical range of the terrain).

The lower the value, the higher the precision, but smaller vertical range (and vice-versa).