3. IMPORT DTM AS LANDSCAPE

TerraForm generates a Landscape Actor from the DTM data you import into UE4. As well as providing a really slick way of creating accurate real-world terrains in UE4, this means that once you’ve imported your terrain, you can use all of the tools, content, physics and performance optimisations that Epic has built in, including:

  • Landscape Sculpt tools – edit/modify imported DTM (sculpt, smooth, flatten, ramp, add erosion).
  • Landscape Paint tools – edit/modify Landscape Layer Masks.
  • Landscape Blend Materials and procedural materials.
  • Grasses and Foliage Spawners – procedurally add vegetation and clutter objects.

It also means you can use content available through the UE4 market place, including landscape materials, foliage and blueprints.

3.1. SOURCE DATA:

TerraForm lets you import DTM data directly into UE4, but for now you need make sure your DTM data meets the following standards. We’ll add support for more formats and other DTM specifications soon.

3.1.1.  Data Formats:

TerraForm needs 32-bit floating point DTM data in GeoTIFF (.tif) format. This is one of the most common formats of DTM data and any GIS software worth its salt can export it.

3.1.2.  Projection/Datum:

For now, TerraForm doesn’t re-project your DTM data. It simply reads the projection information and stores it in the TerraForm Landscape Anchor, so that other datasets can be imported on top (such as vector lines).

UE4 works in a linear Cartesian coordinate space, so your DTM data needs to be in a Local Cartesian Projection. You can use any projection that meets this criterion. We find the UTM Projection system with a WGS84 Datum works well in most cases and is a good fall-back option if you’re not sure what else to use. Make sure you pick the right UTM zone for your DTM though (e.g. UTM Zone 30N for UK).

3.1.3. Dimensions:

Your DTM source file can be as big as you like within GeoTIFF file size limits (2GB). TerraForm can rescale the DTM to your desired landscape size, but the bigger the DTM, the longer the import process takes.

UE4 will only let you use a maximum of 8,129 x 8,129 vertices (Overall Resolution) in your landscape – any bigger than this and UE4 will crash, so it makes sense to try to make your DTM dimensions as close as possible to the overall resolution you want to use. For example, if you want to create a landscape with an overall resolution of 8,129 x 8,129 vertices, your DTM should be approximately 8,129 x 8,129 pixels.

TerraForm can create rectangular (non-square) landscapes, up to a maximum of 8,129 vertices in either X or Y dimension.

3.1.4. Scale:

As long as the landscape you create is no more than 8,129 x 8,129 pixels, the pixel size can be whatever you like, within reason. We’ve successfully imported DTM data with a pixel size of 30m/pixel to create a landscape 200km x 200km. We wouldn’t recommend using single landscapes this big though – you can end up with object placement issues due to single floating point precision in UE4.

3.1.5. Resolution/Units:

In UE4, distances are measured in metric (centimetres/metres) or imperial units (feet/inches) in 3-dimensions, along x, y, and z axes – you can set your units in the UE4 Editor: Edit > Project Settings > Editor > Appearance > Units.

TerraForm supports data in both Metric and Imperial units, so you can set the UE4 Editor to your preference, however we’d recommend using metric units to keep things simple.

3.1.6. Compression:

TerraForm supports common GeoTIFF compression algorithms, such as LZW and ZIP.

3.1.7. Aux Files:

TerraForm first looks for DTM metadata (projection, datum, units, pixel dimensions etc.) in the header information embedded in the GeoTIFF file itself. If the header isn’t there, TerraForm will look in associated header files (.prj, .wld, .tfw etc.). Strictly speaking though, if the metadata isn’t stored in the file header, it’s not really a GeoTIFF. As long as your GeoTIFF DTM file has header information, TerraForm doesn’t require auxiliary files.

3.2. TERRAIN MODEL IMPORT OPTIONS:

Once you’ve hit the Import DTM as Landscape button and selected the GeoTIFF DTM file you want to import, TerraForm will show you the Terrain Model Import Options window. Here you can set options for the UE4 Landscape Actor you’ll create. It looks like this:

3.2.1. Information:

The top section of this window shows you some information about the DTM source file you’re importing:

Source File: This is the name of the source file you’ve selected to import. Fairly self-explanatory.

Asset Path: This is where the TerraForm Landscape Anchor projection data will be stored.

Source Dimensions: The dimensions of the source file in pixels.

Pixel Size: The size of each pixel in metres.

Landscape Origin: The location of the top-left corner of your DTM in the source coordinate system.

3.2.2. Landscape Settings:

These settings give you the control to create a Landscape Actor that meets your requirements. There are trade-offs you should consider with respect to performance/quality, depending on the platform you’re creating your game for. Further information can be found in Epic’s UE4 Landscape Technical Guide, which you can find here:

https://docs.unrealengine.com/en-US/Engine/Landscape/TechnicalGuide/index.html

These settings will affect the performance of your landscape, as well as the size/detail.

Quads per Section: A quad is the smallest unit of a landscape.

Sections per Component: Sections are the base unit of landscape LOD calculations.

Number of Components: Components are Unreal’s base unit of rendering, visibility calculation and collision. Epic recommends keeping landscapes below a total of 1024 (32 x 32 components).

Overall Resolution: Adjusting the settings above within the limitations and guidance provided by Epic’s technical guide allows you to optimise the size/detail/performance of your landscape for your application.

3.2.3. Material:

Landscape Material: You can set the material you’d like to apply to your landscape here.

3.3. TERRAIN MODEL IMPORT OPTIONS:

When you import DTM data, TerraForm creates a new landscape actor to the specifications you input in the Landscape Settings and sets the scale so that your landscape is the same size as your source DTM in UE4. It moves your landscape so that its centre is at x=0, y=0, z=0 in Unreal’s coordinate system and then resamples the source DTM elevation data and copies it into the landscape.

3.3.1. GIS Projection Asset:

The projection information for your GIS data (projection, datum, scale, dimensions etc.) is retained in the TerraForm GIS Projection Asset, which is created each time you import a DTM file, and stored in a folder in the Assets Path. TerraForm reads the GIS Projection Asset when you import GIS vector data into your landscape.

3.3.2. TerraForm Landscape Anchor:

TerraForm also creates a TerraForm Landscape Anchor that is used to link the GIS Projection Asset to the landscape and stores the origin of the landscape in the coordinates system (projection/datum) of the DTM data. The landscape is parented to the TerraForm Landscape Anchor during the import process and must remain so if you wish to import more GIS data.