This page has been translated automatically.
UnigineScript
The Language
Core Library
Engine Library
Node-Related Classes
GUI-Related Classes
Plugins Library
High-Level Systems
Samples
Usage Examples
C++ API
API Reference
Integration Samples
Usage Examples
C++ Plugins
Migration
Migrating to UNIGINE 2.0
C++ API Migration
Migrating from UNIGINE 2.0 to UNIGINE 2.1
Warning! This version of documentation is OUTDATED, as it describes an older SDK version! Please switch to the documentation for the latest SDK version.
Warning! This version of documentation describes an old SDK version which is no longer supported! Please upgrade to the latest SDK version.

Terrain Dimensions and Formats

Terrain Dimensions and Texture Formats

Size
  • The maximum size of a terrain (the height field size) is 32768+1 × 32768+1, which is equivalent to the vertex count.
  • The minimum size of a terrain is 256+1 × 256+1.
Height map The height map is imported during terrain creation. It needs to be of a power-of-two + 1 size (such as 257 × 257 or 513 × 1025). The possible formats are the following:
  • R8 - a simple height map with 256 height gradations.
  • R16 - a height map with 65536 height gradations.
  • RG8 - a height map with 65536 height gradations. This format can be used, for example, when the height map is exported.
Holes The texture that determines holes placement on the terrain. It needs to be of a power-of-two + 1 size to cover the entire terrain.
  • The possible format is R8.
  • Holes are cut per vertex and always have squared corners.
Diffuse and Normal The diffuse texture as well as imported normal map needs to be the of the power-of-two size (for example, 256 x 256).
  • Alpha channel of the diffuse texture controls the specular intensity.
Mask The mask texture needs to be of the power-of-two size. Each channel of the mask controls the visibility of one detail material (according to their order on Materials tab):
  1. Red channel defines the visibility of the 1st material,
  2. Green channel - of the 2nd material,
  3. Blue channel - of the 3rd material,
  4. Alpha channel - of the 4th material.

Mask channel value of 256 indicates that a detail material (it is mapped to) is visible; 0 results in no detail material.

The possible mask formats are the following:

  • 3D texture of R8 format that allows to mask from 1 to 4 detail materials
  • 2D texture of the following formats:
    • R8 - to mask 1 material
    • RG8 - to mask 2 materials
    • RGB8 - to mask 3 materials
    • RGBA8 - to mask 4 materials

For each surface, a texture of the necessary size can be reassigned, introducing more or less resolution on demand.

Notice
Never forget to compress all terrain textures!

Here is the example of terrain configuration. All sizes are specified for compressed textures.

Terrain Size The Number of
Surfaces
Maximum Size of
Terrain Texture*
Height Map Normal Map
(ATI2)
Diffuse Texture
(DXT1 / DXT5)
Mask Texture
(DXT1 or ATI1 /
DXT5 or ATI2)
Total Size
16384 × 16384 64 × 64 262144 × 262144 512 MB 256 MB 128 MB / 256 MB 128 MB / 256 MB 1024 - 1280 MB
8192 × 8192 32 × 32 131072 × 131072 128 MB 64 MB 32 MB / 64 MB 32 MB / 64 MB 256 - 320 MB

* The maximum total size of any terrain texture implies that each surface is assigned a texture of maximum 4096 × 4096 size.

Terrain File Structure

Terrain data is stored in the following files:

  • .ter file stores the meta information about terrain object, such as bounding box of terrain, bounding boxes of surfaces and whether they are enabled or disabled. It also stores vertices of a coarse level (LOD 8).
  • .ter0000 (and files with names of incremented hexadecimal value) store information about heights in terrain surfaces (up to 8×8 maximum), LOD 1 and LOD 4, as well as information about holes.
  • _d.dds is a coarse diffuse texture.
  • _n.dds is a coarse normal map.
  • Per-surface diffuse, normal map and mask textures (00x00_x.dds with a postfix) are stored in a separate folder that is named after the terrain file.
Notice
It is recommended that terrain files are not archived, as accessing them in real-time will result in slowing down both rendering (textures and height maps streaming lags) and physics calculations.
Last update: 2017-07-03
Build: ()