The Language
Core Library
Engine Library
Node-Related Classes
GUI-Related Classes
Plugins Library
High-Level Systems
API Reference
Integration Samples
Usage Examples
C++ Plugins
Content Creation
Unigine Material Library


TerrainMesh is a console tool for creating height maps from the meshes or directly from OBJ files.

To invoke TerrainMesh, run terrainmesh_x86.exe (in Windows) or terrainmesh_x86 (in Linux) from a command-line console (the 64-bit version has x64 postfix).

Command Line Options

TerrainMesh recognizes the following command line options:

  • -o NAME — name of the output file.
  • -s SIZE — size of the output image (width equals height). The default is 1025x1025.
  • -w WIDTH — width of the output image. The default is 1025.
  • -h HEIGHT — height of the output image. The default is 1025.

Input and Output Formats

All mesh formats that can be converted into Unigine meshes are supported. A list of such formats is available here: Supported File Formats.

The following output formats are supported:

  • Portable Network Graphics (PNG)
  • PhotoShop Document (PSD)
  • Direct Draw Surface (DDS)


The syntax for Windows is:

Shell commands
terrain_x86.exe OPTIONS FILE

The syntax for Linux is:

Shell commands
terrain_x86 OPTIONS FILE

Type of an output file is determined based on its extension (see the -o option).
For example, to create a height map from a mesh, use the following:

Shell commands
terrain_x86.exe mesh.obj

Height Map Creation Example

To create a height map out of the 3D mesh in obj format, you need to do the following:

  1. Open the command-line console. For Windows, click Start→>Run and type cmd. Click OK.
  2. Now, suppose the following:
    • You have a mesh called myterrain.obj located in the folder C:\My Stuff\Raw.
    • Your terrain size need to be 1024×1024 cells.
    • You want to save a height map into a file C:\My Stuff\Raw\height map.png.
    Then you need to invoke TerrainMesh as follows:
    Shell commands
    terrainmesh_x86.exe -o "C:\My Stuff\Raw\height map.png" -s 1024 "C:\My Stuff\Raw\myterrain.obj"
Last update: 2017-07-03