Creating a DecoLayer
DecoLayers generate Static Meshes everywhere on the terrain. You can only see the ones that are inside a
radius you can set, to save resources. Also, the StaticMeshes from a DecoLayer are able do not impede players,
so using them for trees isn't realistic, but DecoLayers are better used for grass, flowers and ferns.
To create a new DecoLayer on a Terrain go to the Terrain Editor and click on the Decorations tab and press "new".
You can also add more than one DecoLayer if you like. Before the DecoLayer works, you have to set a lot of
settings. First give it a StaticMesh by right clicking on the newly created DecoLayer.
This tells the DecoLayer what it will be rendering.
Then you must create a new Terrain Layer. Get a texture that is very different from your terrain
(for instance an checked texture –although make sure it's an RGBA8 texture with an alpha channel or a
P8 texture). Create a new Terrain Layer by clicking on the “Layer” tab of the Terrain Editor,
then click the "new" button. Be sure to enter the texture’s correct dimensions in the AlphaHeight
and AlphaWidth fields. Also you should create this layer at the bottom of the layer stack.
If you did not, you can move it to the bottom by selecting the layer and using the shift up and down buttons.
Next, select the Layer Texture that was created in the Texture Package “MyLevel” in the Texture Browser
(Decoalpha1 in this example). Go back to the Decorations Tab and then right-click on the DecoLayer and
choose the “Set Density Texture from Current.” This tells the DecoLayer where to lay the decorations using
an alpha channel. The white parts of the alpha channel, or the highest places in the palette of the P8 texture,
will become the places where the most Static Meshes will be generated.
You can also create your own textures maps to use as a Density Texture. If you just want the whole terrain to
be grassy, you can use for example a white Density Texture, but if you want the grass to be only in the
NW corner of the terrain, make the Density Map black everywhere, except in one corner.
For example, you can create a crop circle with it.
The next options to set are in the Properties window of the Terrain Info.
To open this, just double click on the TerrainInfo name in the Terrains tab of the Terrain Editor.
Go to the TerrainInfo rollout within the Properties window and then expand the DecoLayers section.
Then expand the DecoLayer enumerated as “[0]”, and under the FadeoutRadius enter a large value for the Max,
and a smaller value of for the Min. Between each Min and Max FadeOutRadius,
the Static Meshes will become more and more transparent, until they become invisible.
For example in the screenshot the Min FadeOutRadius is 500 and the Max is 1200.
Both radii are marked with a yellow circle on the screenshot.
Everything inside the smallest circle is opaque, everything between both circles is translucent,
and outside the circles everything becomes invisible.
The last in adding the DecoLayer Meshes to your map is to paint them on to your map.
To do this, go back to the Layers tab of the Terrain Editor and select the layer you created
(Decoalpha1 for this example). If the checkered texture you selected as the Density Texture is showing
up when you paint on the DecoLayer Meshes simply go to the Layer tab in the Terrain Editor and move
the Layer one below the rest of the Layers in the stack.
This causes the terrain to no longer render the texture;
however you can still select that layer and paint with it.
NOTE: Do NOT paint while you have the DecoLayer selected under the Decorations tab.
This can create holes in the Density map which prevent you from painting on StaticMeshes anywhere
on those holes.
PROBLEMS
The static meshes are not showing up while you paint, and even when you leave the terrain editor,
they still don't appear. Don't panic, this is a very basic and simple setting that you can switch off
and on in the game settings, fact is that you can simply switch it on again here in UED with one
single value, it will also show the deco layers in game again.
- In UED go to the main menu > View Advanced Options > expand Display > DecoLayers = True
- In Game go to settings and check Foliage ON.
Fixed for both Game and UED. Done
There are other options for adjusting the DecoLayers within the TerrainInfo rollout.
Below are descriptions of what each of field controls.
AlignToTerrain
If this is set to [1], this setting will cause the DecoLayer to rotate the StaticMeshes to align
with the normal of the quad that the mesh is sitting on.
If left at [0] the StaticMeshes will all be vertical.
Aligning to the terrain can be useful for such things as rocks and debris,
but when used on trees and grass it can look out of place.
ColorMap
This map changes the color of the decorations on different locations.
It has to be a RGBA8 texture; otherwise all decorations will become black.
This effect is best visible on white or very bright Static Meshes.
For example, white Static Meshes become like this if you use a colorful ColorMap:
You can also paint a color on the DecoLayer manually: go to the Terrain Editing Window,
select the tool "Color", pick a color with the Color button, and then go to the Decorations tab and
select the DecoLayer you want to paint on. Then you should be able to paint on the terrain in the 3D View.
DensityMap
This is the Texture Map you assigned by right clicking on the Layer in the Terrain Editor.
From here you can reassign it to a different texture by first selecting a texture in the Texture Browser
then clicking the “Use” button in this field when it is selected.
DensityMultiplier
These fields vary the number of StaticMeshes that are placed in the painted DecoLayer area on the terrain.
I’m not sure how exactly the Max and Min values separately determine the number ofStaticMeshes placed,
but they do each do different things. Experiment with each to find the appropriate density of
DecoLayer StaticMeshes.
DetailMode
This defines the minimal detail that has to be set before this decolayer is shown.
The minimal value is DM_Low, in this case it will always be shown, unless decolayers are completely
turned off ( DecoLayers in [WinDrv.WindowsClient] ).
With DM_High it's only shown in high detail mode ( HighDetailActors in the render device settings),
and DM_SuperHigh is just for eye candy ( SuperHighDetailActors in the render device).
DisregardTerrainLighting
Setting this value to 1 will force the deco meshes to ignore the lighting value of the quad they rest on,
and make them appear fullbright.
DrawOrder
The DrawOrder allows you to set in what order the decorations should be drawn.
SORT_BackToFront draws the ones far away first and then the ones close to the camera,
and SORT_FrontToBack does the opposite. SORT_NoSort uses no specific order.
You can use this setting to prevent problems with AlphaTextures:
if the near trees are drawn first, and after that the distant trees,
the engine may forget to draw these behind semi-transparent parts of the AlphaTexture if AlphaTest is on.
This is shown on the first screenshot. If you now set DrawOrder to SORT_BackToFront, the distant trees are
drawn first, and the AlphaTexture from the near trees is blended correctly over them.
Since there are only three different settings, it is pretty easy to experiment with each of the settings
to see which works best for your situation if you’re not sure which one to use.
FadeOutRadius
These are the radii that the StaticMeshes begin to fade out.
The Min setting determines the distance from the camera at which they start to become translucent,
and the Max setting determines the distance from the camera at which they become entirely transparent.
LitDirectional
If this value is set to [1], it forces the StaticMeshes to use sunlight.
It can look very bad in some cases, as it will cause shadows on things like grass and such.
MaxPerQuad
This value sets the maximum number of StaticMeshes placed per quad.
RandomYaw
If this is set to 1, the StaticMeshes will be randomly rotated along the Z axis which helps break up
‘tiling’ appearance. Be aware that this may cause AlignToTerrain to work incorrectly.
ScaleMap
You can add a ScaleMap on the DecoLayer, this is a RGBA8 texture that determines what size the decorations
have on different locations on the terrain. This is done for X, Y and Z independently: the red and green
channel determine the width and length, and the blue channel the height. For example if you use the texture
from the left picture as ScaleMap, and the DecoLayer is a forest.
ScaleMultiplier
You also have to enter a ScaleMultiplier, there are six values for a Min and Max X, Y and Z scale.
If you give a different Min and Max, each decoration will get a random size between both values.
Sometimes the Static Mesh is so small or so big that you can't see it anymore, sometimes you really have
to try different values before you can see the decorations.
Seed
These determine different randomly generated layouts for the placement of the StaticMeshes.
If feel that you have the proper density and number of StaticMeshes but the StaticMeshes aren’t quite in
the right place, try entering a few different numbers in here to see if different Seeds will produce
more favorable scatterings.
ShowOnInvisibleTerrain
If this is set to [1], the StaticMeshes will still be rendered even if they are on terrain that has
been hidden using the Visibility Tool.
ShowOnTerrain
Make sure ShowOnTerrain is set to [1]. If you leave it at [0], the DecoLayer will not be displayed.
This can be handy if you created a DecoLayer but you want to turn it off while you work on
the rest of the map.
StaticMesh
This is the StaticMesh you assigned by right clicking on the Layer in the Terrain Editor.
From here you can reassign it to a different StaticMesh by first selecting a one in the StaticMesh
Browser then clicking the “Use” button in this field when it is selected.
|