Game Editor (Workbench) Material Editing

From Bohemia Interactive Community
Jump to navigation Jump to search

Terrain Materials Editing

Terrain material editing is very similar to the HeightMap editing. Tools are the same, but they don't edit the heigtmap, but the alpha channel of the alpha layer texture.
The texture can be found in: ApplicationFolder/Worlds/TerrainFolderName/TerrainName_X_Y_layer.dds

Actually only 5 detail layers can be placed on one block. One layer is a basic (primary) one which covering whole block and doesn't need any channel. After terrain creating is in the channel "default material", which will be replaced by first user editing ( LMB click ). With the first click the "Terrain Manager" window will appears and there you have to choose the size of the layer texture per tile (can be changed later).

Other layers is saved in each channel of layer texture B, G, R and as last A. When you paint a layer placed under another layer, it is used but you maybe will not notice, because you will not see it ( it is overlaped with that layer above).

IMPORTANT NOTE:
SuperTexture has crucial influence for correct displaying of layer material (color is heavily taken from supertexture).
This means you have to recalculate super texture ( shortcut is "B" key ) after you draw layer material to see it correctly (especially at first time when the default texture (orange one) is everywhere )

Available Materials

Available Materials.jpg


The materials for terrain is defined in global materials in class "TerrainMaterial". To use these materials on current terrain you have to add each material into the current terrain. All usable materials can be found in listbox "Available materials".

  • For adding new material Select material you want to use on terrain in the "Available materials" listbox and click on use button (on the right side ) and the material will be added to the "Used Materials" listbox.
  • Above the use button is preview of the texture, double click on the picture will show up full size preview of the diffuse texture.

Materials Selection

Used Materials.jpg


To draw a material on terrain you have to select material in "Used layers" listbox (you will see "Material MaterialNameWithPath" in header ).

  • The numbers behind the materials in lilstbox showing their order in current block. If there is no number, the material is not used on the block.
  • On the right is material preview (same as in available materials), but the border shows the defined color for "Layer debug view".
  • "Show used layer only" - showing only actual used materials in block which is currently under cursor.
  • "Delete layers above edited layer" when painting material on the terrain with this checked, it will automatically delete above layers used in this block (the materials with the higher number).


While painting with material the current material is automatically added into the list of materials in current block. If is already five materials used on block, it will not paint nothing a error message will show up in console (F2). Count of materials per block can be found in menu Terrain -> Other -> Terrain Preview.

Tool Parameters

Tools Parameters.jpg


Is same as in height map tool, but there is one more button:

  • Del - will delete the material from the current block.











Layers Operation

Material Context Menu.jpg

Can be found in material context menu -> double click on material in "Used materials" listbox. When starting with new terrain is usually good to generate basic coverage with materials. Example: We want to have sand on the beach, rock on big slopes of terrain and all the other will be covered with grass. This all can be automated via Layer Generator.

Layer Generator

Layer Generator.jpg

Select height properties

  • Maximum height - max terrain height where the generation has max influence
  • Minimum height - max terrain height where the generation has max influence
  • Maximum height extension - overlap over max terrain height (for continual gradient)
  • Minimum height extension - overlap over min terrain height

In range "Minimum height - Minimum height extension" -> "Maximum height + Maximum height extension" will be material generated. Schematic illustration is on the right side.

Select Angle Properties

  • Minimum angle - mim terrain slope where the generation has max influence
  • Maximum angle - max terrain slope where the generation has max influence
  • Minimum angle extension - overlap over min terrain slope
  • Maximum angle extension - overlap over max terrain slope

In range "Maximum angle - Maximum angle extension" -> "Minimum angle + Minimum angle extension" will be material generated. Schematic illustration shows rising slope.

Select Alpha Properties

  • Minimum alpha
  • Maximum alpha

The resolution of the generation is in standard interval from 0 to 255 here you can change it.

Other Setting

  • Probability - probability of layer generation example: 0,75 = 75% will be material used, else not - "sharp noise"
  • Random added - randomly added value x 255 - "soft noise"
  • Restriction - Restriction material generation for exact angle in XY plane. It's good for materials with different mapping than standard XY
  • Select filter - final texture filtering
  • Filter passes - count of passes through the filter
  • Select final operation - what will be done with generation results:
    • replace
    • add alpha
    • subtract alpha
    • multiply alpha
  • add non existing material - material is generated only on block where was added by user. This option will generated them also on blocks where is not placed yet (if there is no already five materials).


If you have some block selected, the layer will be generated only these block, otherwise it will be used on all blocks.

Remove Whole Layer

Remove the material from all block on the current terrain (same as "del" button).

Replace Layer Material

When selected a combobox appears where you can select a new material which will replace the selected one.

Replace Default Material

If is default material ( the orange one ) present anywhere on the terrain, this option will replace it by selected material.

Show Layer Coverage

Will mark all blocks of terrain (where is the material used ) by green squares.