This document provides an overview of creating terrain layers and painting them on the terrain in the Sandbox Editor. The creation of different terrain types works like the painting in layers in common 2D graphic design programs. In order to paint terrains, it is necessary to use different Sandbox components.
Please refer to the Creating a New Map tutorial to prepare to use this tutorial.
After creating a new map, on the Terrain menu, click Texture.
The Terrain Texture Layers Editor dialog box looks like this:
The Layer Tasks menu on the left hand side provides quick access to common Terrain Texture Layer tasks. Click Add Layer to add a new layer. By default, the insertion point will jump into the bar of the new layer so that it can be named directly after creation. It is recommended that you name the layers in a way that identifies their use e.g. rock, grass, etc.
CryENGINE uses two components for painting a terrain:
The distance at which low and high resolution textures transition is controlled via the DetailLayersViewDistRatio property found in the properties: RollupBar -> Terrain -> Environment.
Select the layer that you wish you edit. Click Change Layer Texture on the left toolbar of the Terrain Texture Layers.
This displays the Preview dialog box. Select an appropriate low resolution .dds texture from the Terrain folder.
Alternatively you can bring up the preview dialog via the Layer menu and select Load Texture.
Open the Material Editor by clicking on the material property in the Terrain layer, which by default is set to Materials/material terrain default.
Now, from the terrain folder, select a material.
After selecting the desired material, the selected material now needs to be applied to the layer. Return to the Terrain Texture Layer Editor, select the desired layer on the Terrain Texture Layers, and click Assign Material in the Layer Tasks Menu.
The detail material has to use Terrain.Layer shader and should output high frequency variations of gray color.
Usually this can be achieved by applying a high-pass filter on the diffuse texture in Photoshop and by setting material diffuse color to full white.
Base color of material (like green for grass) should come only from terrain base texture.
In other words we put high frequency details into detail material and low frequency into terrain base texture.
Below is an example of the poor blending results that can happen with incorrectly setup materials:
Access the layer painter under RollupBar > Terrain > Layer Painter. At the bottom of this panel, you will notice a list with all of the layers set up in the Terrain Texture Layers.
In the Brush Settings section, there are two sliders that modify the radius of the brush and the hardness of the applied texture.
The Radius slider changes the size of the brush.
The Hardness slider changes the strength of the brushes painting between texture and color. A lower value will only paint the detail texture, while a higher value will include color information and detail texture.
Keep in mind whether the Paint LayerID check box is enabled or not as this will determine if you are painting the detail texture or not. If you just want to paint the detail texture without the colour information, then you would have a hardness of 0 and have Paint LayerID enabled. Alternatively if you just want to paint the colour information without the detail texture, you would have a hardness of 1 and Paint LayerID disabled.
Now, click and hold down the mouse button in the Perspective viewport and move the mouse pointer around. The terrain will be painted, wherever the brush moves.
The Filter option gives the ability to modify the basic color and brightness of the paintbrush.
Move the brightness slider left and right to control the brightness of the terrain layer.
You can also apply a colour tint to the Terrain Layer, click on the colored box to open the color selection window:
You can select a new color from the colour window or use the colour picker to select a colour from the world; this can be useful to improve object and vegetation blending with the terrain.
Click OK and the Colour option will show the new, selected color.
Now, click and hold down the mouse button in the Perspective viewport and move the mouse pointer around. The terrain will be painted with the new settings, wherever the brush moves.
The terrain in Sandbox can be split into multiple tiles and can be painted with a resolution of between 64x64 and 2048x2048. This gives more flexibility over where higher/lower resolutions can be used in your level. Each tile can have a different material resolution,and the higher the resolution the softer the transition between painted Terrain Texture Layers.
You can split the tile size in your level my selecting the Refine Terrain Texture Tiles option in the Terrain Texture Layers File menu.
The size of the tiles in your level will then automatically split by 4. So if you have 4x4 tiles, after further refinement, you will then have 8x8 tiles. NB: Do this only as necessary, as there is no way to reduce tiles!
You can get a quick overview of the your terrain tiles from the main toolbar in Terrain > Export/Import Terrain Texture. Here you can see a map of the various resolutions contained in the Forest level.
In order to change the tile resolution of map, please follow the following steps.
Until recently, the method of changing the tile resolution was done through the rollupBar. However, this function has been moved into the Export/Import Terrain Texture tool. A much more straight forward method of selecting the tile and changing it directly from this window, rather than through the perspective viewport.
Simply click on a tile then click on the "Change tile resolution" button below the tile overview.
Here, you can select the desired resolution. After clicking OK, the terrain will be changed to the new resolution. When you're finished resizing your tiles, simply click "Close" on the tool window.
As you can see, a well painted terrain can look very realistic. If you have a good vegetation setup and good brush placement, you can achieve incredible results.