UDN
Search public documentation:
EditingTerrainLayers
Interested in the Unreal Engine?
Visit the Unreal Technology site.
Looking for jobs and company info?
Check out the Epic games site.
Questions about support via UDN?
Contact the UDN Staff
Editing the Terrain Layers
Document Summary: An introductory document on editing Terrain Layers. Document Changelog: Last updated by Michiel Hendriks, minor fixes. Previously updated by Jason Lentz (DemiurgeStudios?) to separate into smaller docs. Original author was Lode Vandevenne (UdnStaff).The TerrainInfo
While the Terrain Editing Tools make it extremely easy to make terrain, you should also know the theory behind it and how it works, and the best way to see how it works is to take a look inside the properties of the terrain. And to work with layers, explained in a later section, some things are only possible in the properties of the TerrainInfo. The most important actor for terrain is the TerrainInfo. The TerrainInfo IS the terrain, all the hills and valleys are drawn around it with the TerrainInfo in the center. The Terrain Editing Tools placed a TerrainInfo automatically at the position of your camera in the 3D view when you pressed "New...", but you can also place them yourself, the same way as you placed the ZoneInfo: it's in the Actor Class Browser under Info. A TerrainInfo looks like a small sprite texture with little mountains. In the properties of a TerrainInfo is set what TerrainMap it has, what Textures and AlphaMaps, what DecoLayers, and some additional settings. If you open the properties of a TerrainMap you created with the Terrain Editing Tools, you'll see some properties are filled in already. You can access the TerrainMap properties by either double clicking on the name of your TerrainMap in the Terrain tab of the Terrain Editor, or you can right-click on the mountain icon in any one of the viewports and select "TerrainInfo Properties" from the top of the list. The properties specific to Terrain are located in the TerrainInfo rollout at the bottom. To see the different Layers of the Terrain (AlphaMaps as well as Textures), expand the Layers section under TerrainInfo and it will show you the long list of available slots to add Layers into. You should also have the Layer(s) you've already assigned at the top of this list. To change it to another texture, first select the texture in the Texture Browser, and then press the little "Use" button that appears in the TerrainInfo Properties on the setting of the Layer you want to replace the corresponding texture.. The TerrainMap should be a P8 or G16 texture that is in the MyLevel package, and the AlphaMap should be a RGBA8 texture that is in MyLevel. As you may have noticed, the Terrain Editing Tools had created these textures for you, which is the easiest way, because otherwise you have to create such a texture with a painting program and import it into the Texture Browser. Another thing the Terrain Editing Tools have done is setting a proper scale for the texture: UScale and VScale in the Layer[0] property should not be 0, because a texture with scale 0 is invisible, so set them to 1 or less or more if you want the texture to be smaller or bigger.Layer Hierarchy
The Layers use a hierarchy to determine which textures will be drawn above the others. It's somewhat counter-intuitive though as the closer the layer is to the bottom of the contiguous stack, the more towards the top it is drawn on the Terrain. The Layer that is at the top of the stack (Layer [0]) will automatically be given a completely white AlphaMap so that as the base layer it is completely opaque. You can alter the order and appearance of the layers with the buttons on the side of the Terrain Editor when you are in the Layers tab. Here is what each of the following buttons do:- Use this button to remove the selected layer
- This button will make an exact copy of the selected layer
- These buttons will move the selected layer up or down in the layer hierarchy. The more down a layer is in the list, the more on top it will be on the terrain.
- The Grid Options button will allow you to show or hide a grid on any of the layers
Layers
The terrain you now created has only one layer: Layer[0] with the grass. You can give the terrain up to 32 different layers. Every layer has a Texture and an AlphaMap. The Texture is a tileable pattern for the layer, for example grass, and the AlphaMap is a large alpha channel that determines on what places of the terrain the texture will be present, not present or anything between this. The Texture can be any texture or material, the AlphaMap has to be a RGBA texture. You probably want Layer[0] to have a completely white AlphaMap, otherwise the terrain becomes transparent. Other layers need a white part in the AlphaMap only there where you want their texture to be. For example to create snow tops, use a new layer a snowy Texture, and use an AlphaMap that is black everywhere, except at the places where there are high peaks in your TerrainMap.Creating a New Layer
To make new layers, use the Terrain Editing Tools, go to the Layers tab, select the topmost empty layer in the list and use the button. Leave package to "MyLevel", as it's much handier to work with because you will probably edit the AlphaMaps quite a lot while building the map and if it isn't in MyLevel you have to save the texture package it's in every time you save your map. MyLevel gets saved automatically inside the map file. Also make sure you give all the AlphaMaps another name, and to make it easy for yourself put then inside the same group. All of the settings in the New Layer dialog are described here:- Package - It's best to place the AlphaMaps in the MyLevel package. This is a package that is stored in the *.ut2 file of level itself and not in an *.utx file you have to save. To place a texture in the MyLevel package, type MyLevel as Package when importing a texture. The reason for this is, when you are going to edit the AlphaMaps later, you are actually changing the texture you used as AlphaMap. If you don't place it in the MyLevel package, you have to save the texture package every time you edited the terrain.
- Group - The Group you assign the HeightMap to is not as crucial and can be named pretty much anything.
- Name - Be sure to use a different AlphaMap for every layer, because if two layers use the same texture and you edit one of them, the other one will be edited too.
- AlphaHeight & AlphaWidth - It is very important to make sure that these values match the dimensions of the texture you are using. Otherwise, the texture may only appear as spots on a regular grid.
- AlphaFill - This determines the transparency of this texture over the layers above it in the Layers stack. The default setting of [0] should work fine (assuming you are using the 2110 build or newer).
- ColorFill - This setting is ignore. In earlier versions of the engine, this could create a color on the Terrain.
- UScale & VScale - These affect the scale of the texture map as it is applied to the Terrain. If you don't get it to look quite right the first time, don't worry. You will be able to easily edit later so that it is an acceptable scale.
Layer Properties
Once you've created the layer, you can open the properties tab (as described above) and you are able to set the following properties:- AlphaMap - From here you can assign a different Terrain that this Layer will be assigned to. First you must select the new Terrain's AlphaMap from the Texture Browser and then you select the "Use" button in this field.
- KFriction - Information to be added later.
- KRestitution - Information to be added later.
- LayerRotation - This allows you to project this Layer onto the Terrain in directions other than just straight down. This is useful for painting Textures onto Terrain that is more vertical (like a cliff or a raised cylinder to create a tree out of Terrain) and it won't stretch like it normally would if projected from directly above.
- Texture - After selecting a Texture for the Texture Browser, you can click here and press the "Use" button to assign your chosen Texture to this layer.
- TextureMapAxis - Much like the LayerRotation field, these settings allow you to pick one Axis to project the layer onto. The LayerRotation field is more useful for applying textures at non-regular angles, while this field is useful for quickly setting the Layer to project from a particular Axis. For a more detailed explanation, see the TextureMapAxis section below.
- TextureRotation - this determines the rotation of the grass, dirt, snow or any other texture you used, expressed in degrees.
- UPan and VPan - the panning of the texture
- UScale and VScale - the size of the texture along the X and the Y-axis. These values will be 0 by default, but you better set them to 1 or another value for the best effect.