Texturing Your Terrain

From CryWiki

Jump to: navigation, search

Welcome to the CryWiki tutorial for applying textures to your map. In this tutorial you will learn how to colour your terrain, and then apply material layers and textures to your map.

Contents

Texture Introduction

Below is a brief explanation of each of the terms that will appear in this article, which should help you understand how the texture system works in CryEngine 2.

Terrain Layers

The terrain layer is the final product that you apply to your terrain using the Layer Painter tool (this will be covered later). It comprises of the distance texture, the detail texture and the terrain colour.

Distance Texture

This gives a neutral tone to the texture of the terrain that you see in the distance. It effectively splits up the colour of the terrain layer you've chosen into a different pattern at longer range. This is tiled all over the terrain that you see in the distance so that the terrain you see doesn't just look like a solid block of colour.

Detail Texture

The detail texture is the surface that you see on the ground at a very close distance, and as the name suggests is much more detailed. You can create anything from a sandy beach to rocky cliffs with the various detail textures on offer, and this is the main choice you'll be making when choosing terrain layers.

Creating Your Terrain Layer

To start off, we are going to choose the detail texture; this will be one of the most important things about your texture, so make sure you choose one that perfectly fits your terrain. To access the detail texture list, you need to open up the Texture editor. This is found in the Texture menu, as shown below.

Note
Never utilise the current "default" layer, as it often can cause bugs in the layer painting. Try to create new ones and not edit the existing layers.

Once you have opened the editor, take a look at the interface (shown below). Although it may seem complicated, it in fact becomes quite intuitive to use.

The Layers Menu
Shown on the left hand side (although initially only with the "Default" layer), it will contain all the terrain layers you create for your map. You also have the option to delete and add new ones, and move the up and down the order.
The Surface Type
This is the alternative name for the detail texture, and displays which surface type you have chosen for your terrain layer. In the Edit Surface Types menu is where your detail texture is chosen for the surface type, and we will look at this in more depth later.
The Texture
This is the distance texture that you have chosen for your layer. Although not visible because of the fact the default layer has no distance texture, information about the texture including the resolution size will be displayed here, as well as a thumbnail image of the texture where the black box is.
Layer Mask Generation
This section allows you to adjust what elevation and angle values need to be fulfilled for the layer to be applied. For example, for higher cliff textures you could set it in this section so that the layer will only be painted on angles greater than 70 degrees and higher than 250 units.


Assigning Your Detail Texture

To find the detail textures in the Terrain Layers editor, we need to browse to the Surface Types menu. In the menu (shown below) you'll see that the terrain layer "Default" that we saw in the Terrain Layers editor has been assigned the surface type "Default".

Just below this surface type list we can also see that the detail texture that has been applied to this layer is currently blank. This needs to be changed and then applied to the default layer. To do this, click on the Material Editor and the it should pop up (shown below).

In the Material Editor, click on Materials → Terrain. In this section are all the detail textures possible for use on your layer. These range from cliffs to sands to grasses to concrete, so you should be able to find the texture of your choice. For the purposes of this tutorial we are going to use plains_grass_green_and_dry; to use it, simply click on it and then exit the editor.


Note
If you want to preview the texture you are using, enlarge the material editor so that it encompasses most of the screen, and then hover your mouse over the Diffuse button in any of the textures parameters. This should show you a preview thumbnail of your texture, as shown in the picture above.


Once you have exited the editor, in the Surface Types editor click Pick Selected. Once this is done, the detail texture you chose should appear under Material Name. If once you have applied the layer and find that the texture looks too tiled, return to this editor and adjust the X and Y Scale Mapping to a small value; 0.5 is normally an ideal value.

Assigning Your Distance Texture

With the detail texture assigned, we can now assign the distance texture. Return to the Terrain Layers editor and click on the Load Texture button in the right hand side of the editor. A windows explorer browser should now appear showing all the texture files; this is shown below (however due to the fact that the screenshots were taken with the demo editor only 2 textures exist in that folder). It's important to note that theoretically you could build a level on one distance texture, so this option isn't the most important. However it can help add the little bit more detail at longer range. If you look at the browser you can see that every time you click on a texture a preview pops up below; use this to help you choose your texture. Select one of the files and click Open. The distance texture should now be assigned to your terrain layer in the Terrain Layers Editor.

Painting Your Terrain Layer

Once you have assigned your textures, it's time to start painting the layer onto your terrain. To do this, browse to the RollupBar → The Terrain Tab → Layer Painter (shown below). Firstly, we need to assign a colour to your layer. To do this, click on the little white square next to the Filter slider. The colour picker should now pop up; from here you can choose the exact colour of your layer. Seeing as we chose grass for the detail texture, try to pick a colour that looks quite grassy but isn't too saturated. Although this seems like a basic tool, you can in fact use the picker pen in the bottom right hand corner of the window to pick a colour out of any window you have running at the time, so if you like you can take the grass colour straight out of this article.

Once you have picked your colour, click OK and return to the layer painter. Make sure that Paint LayerID (to make sure the detail texture is applied) and Mask By Layer Altitude and Slope (if you want to limit the layer to certain altitudes and angles) are checked, and click To Layer to save the colour you chose and assign it to your layer.

Now you are ready to paint! Select a brush radius and a brush hardness level, and hold down the left mouse button on your terrain to apply the layer to the terrain. Once finished, you should have something resembling the picture below.

Personal tools