Table of Contents

Terrain Materials

Terrain materials are the used for the coloration of the terrain. In Transport Fever 2 it is possible to assign a 2D texture that is projected on small upright standing faces to emulate grass or wheat growth.

Textures

The terrain materials themselves are defined in .lua files in the res/config/terrain_material/ folder. It has some specific parameters:

function data()
return {
  name = _("Grass Cutted 01"),
 
  detailColorTexture = "terrain/grass_cutted_01_albedo.dds",
  detailMetalGlossAoHTexture = "terrain/grass_cutted_01_metal_gloss_ao_h.dds",
  detailNormalTexture = "terrain/grass_cutted_01_nrml.dds",
  overlayTexture = "terrain/overlay_0.dds",
 
  detailSize = 1 / 32,
  overlaySize = 0.03,
  overlayStrength = 0.25,
  hOffset = 0.3,
 
  order = -40,
  priority = 1
}
end

The name is a string which can be translated in a strings.lua file.


tessellation effect in top down view

The ground texture is defined by the following properties:

The detail textures are required to have 4096×4096 pixel resolution. For this reason it is recommended to be sparing with additional textures.


effect of hOffset and detailMetalGlossAoHTexture

The next set of properties is used to scale the textures from above:

There are several other properties:

Plants

It is possible to define additional plant sprites that are shown above the ground (as long as they are not deactivated in the graphics settings). They are defined in <terrainmaterialname>.lua files in the res/config/grass/ folder whereas the filename usually is identical to the one of the terrain material above.

function data()
return {
  colorTexture =        "terrain/grass/grass_light_green_albedo_opacity.dds",
  metalGlossAoTexture = "terrain/grass/grass_light_green_metal_gloss_ao.dds",
  normalTexture =       "terrain/grass/grass_light_green_normal.dds",
  translucencyTexture = "terrain/grass/grass_light_green_translucency.dds",
  materials = {"grass_light_green.lua"},
 
  width = 1.0,
  height = 1.0,
  density = 6.0,
  lodDistance = 300.0
}
end



The graphics are defined by some properties:

With the materials list can be selected for which terrain materials the plant should be used. Please note that a material can only use one plant at the same time.

The size and distribution of the faces on which the texture is projected are defined with another set of properties:

UI Icons

Terrain materials do not use seperate ui icons. Instead the ground texture is displayed in the bottom menu.