396 Game Development and Simulation with Unreal Technology
TABLE 7.2: Landscape Layer Bl end
Properties
Layers: The list of layers the node contains. Layers can be added by
clicking in the + icon.
Layer Name: The unique name to be used for the layer. The name corre-
sponds to the layer name in the paint mode in the Landscape editing
tool.
Blend Type: The Blend Type of this expression. Specifie s w h ich of the
LB_AlphaBlend, LB_HeightBlend or LB_WeightBlend to use for
blending.
Preview Weig ht: Th is is used as the weight for the layer to preview th e
blending i n the material editor.
Const Layer Input: This is for using a Const3 Vector as the color to be
used if you do not want to use a texture map. Useful for debugging
purposes.
Const Height Input: This is to be used as the value for the height if you
do not want to use a texture for the height map.
Inputs
Layer <LayerName>: Each l ayer adds an inpu t for the layer to blend
together. These inputs will not be available until layers are added in
the Details rollout of this expression.
Height <LayerName>: This is where you supply a height map to blend
with. Note: This input will only be visible on layers that have their
Blend Type property set to LB_HeightBlend.
Output s
Output: The result o f the blended layers.
Example Usa ge:
When you want to have the lan dscape ma te rials blend together
based on a Heightmap of each layer (this can come from their alpha channel,
for exam ple) or their weight, yo u will be able to utilize this expression to
facilitate the functionality.
Terrains and Landscapes in Un real Engine 397
IMPORTANT NOTE
When using the LB_HeightBlen d mode for all Lan dscape laye rs, the re
may be unpleasant artifacts such as black spots on the landscape.
LB_HeightBlend works by modulating the blend factor, for the layer u sin g
the specified height value. This occurs when all the layers painted in a partic-
ular area simultaneously have a 0 height value. The situation is worse when
you are blending a Normal ma p. If ble nding a no rmal map becomes (0,0, 0) it
will cause renderin g problems, as it is an invalid normal. To avoid this prob-
lem use LB_Alph aBlend or LB_Weight Blend for one of the la yers in your
collection of layers [ 26].
IMPORTANT NOTE
If you are using LB_AlphaBlend for one of the layers in your collectio n of
layer in the Layer Blend expression, make sure that its alpha channel is not
zero, otherwise you m ight end up with black patches on yo ur landscape.
IMPORTANT NOTE
If using LB_AlphaBlend or LB_WeightBlend still did not resolve the black
patches in the landscape where layers blend together, add small values such
as 0.1 to the Height value being applied to the Layer Blend expression.
FIGURE 7.10: Landscape Coordinate Expression.
398 Game Development and Simulation with Unreal Technology
Landscape Layer Coords: This ex pression, shown in Figure 7.10, enables you to
generate coordinates that will be used to map materials to the landscape terrain.
TABLE 7.3: Landscape Layer Coordinates Properties
Mapping Type: Specifies th e orientation to use when mapping the ma-
terial or network to the land scape. Types include Auto, XY Plane,
XZ Plane, and YZ Plane. For example, XZ aligns the material to
the XZ plane, while Auto allows the engine to use the best plane to
map.
Custom UV Type: Specifies the UV c oordinates to map on the lands c a pe
based on the given property valu e s.
Mapping Scale: Speci fies the uniform scaling to apply to the UV coordi-
nates.
Mapping Rotation: The rotation (in degrees) to apply to the UV coordi-
nates.
Mapping Pan U: The offset in U direction to apply to the UV c oordi-
nates.
Mapping Pan V: The offset in V direction to apply to the UV coordinates.
Output: Outputs the UV coordinates to apply to the texture samples for
the la n d scape mate rial s.
Landscape Layer Switch: When a particular material network does not contribute
to a region of the landscape you can use this expression to exclude it from the
calculations of the landscape material. This will be a me chanism to optimize your
material by removing unnec essary calculations i.e., when a particular layer’s
weight is 0.
TABLE 7.4: Landscape Layer Switch
Properties
Parameter Name: T h e uniqu e name to be given to the parameter.
Preview Used: If checked, will use a preview.
Inputs
Layer Used: The result to use when the layer specified in the ex-
pression’s properties is in use by the regio n in the landsca pe.
Layer Not Used: The result to see when the layer is not used by the
current region of the landscape and has a weight o f 0.
Output s
Output: Outputs on e of the Layer Used or Layer Not Used, depend-
ing on the contribution to the particular region of the landscape.
Terrains and Landscapes in Un real Engine 399
Landscape Layer Weight: This expression allows ma te rial networks to be blended
based on the weight for the associated layer from the landscape on which the
material is going to be applied.
TABLE 7.5: Landscape Layer Weight
Properties
Parameter Name: The unique name of the layer belonging to the
landscape to be associated to this parameter. The weight for
this layer is used as the alpha value for blending the two input
networks.
Preview Weig ht: Th e weight to use for previewing in the material
editor.
Const Base: A base color for the landscape .
Inputs
Base: The network to blend this layer with. This is generally the
result of any previous layer blending, but can be empty if this is
the rst layer.
Layer: The network to blend together to create this layer.
Output s
Output: Outputs the result of the blending between base and l ayer
inputs based on the layer weight of the layers involved.
FIGURE 7.11: Landscape Layer Weight Expression.
Example Usa ge: Suppose that you want to have two layers in you r landscape
material: the first layer to be a “Dirt” layer and the second layer to be a
“Grass” layer. You will create the network for each of the materials, a net-
work that creates a “Grass” and one that creates a “Dir t” material look . Make
two Layer Weight expressions. Connect the output of your first network
(e.g., the “Dirt”) to the Layer of th e first Layer Weight expression, leav-
ing its Base input unconnected. You will then connect output o f the first
Layer Weight expression to the Base input of the second Layer Weigh t
expression. Connect the network for your second layer ’s material (e.g., the
400 Game Development and Simulation with Unreal Technology
“Grass”) to the Layer input of the second Layer Weight. Connecting the
output of the second expression to the ap propria te channel (Base Color,
Normal, etc.) of the material node will created this layered Landscape Mate-
rial (see Figure 7.11).
Landscape Visibility Mask: To create wholes in a landscape (e.g., creating cave
openings), you can use this expression to remove the visibility of parts of the
landscape.
TABLE 7.6: Landscape Visibility Mask
Output s
Output: Outputs the visibility mask properties.
To activate this expression, connect its sole ou tput to the O pacity Mask cha nnel
of the material node and choose the Blend Mode of your material (in its Details
rollout) to Masked.
Example Usa ge: Each Landscape actor allows you to assign a Landscape Ma-
terial and a La ndscape Hole material.
A Word on Tessellation an d Displacement
You may use the UE4 ’s Tessellation and World Displacement material channel
much like a standard material to add more details and deformations to your terrain.
Simply build the network you want and use the layer blen ding in tandem to create
these effects.
NOTE
Like stand ard materials, the Tessellation and World Displacement in Land-
scape Mater ia ls are limited to use with DirectX11 enabled. If your hardware
does not supp ort DirectX 11, these effects will not be created and ap plied.
Creating and Working with Landscape Materials
Now that we have learned about the Landscape it is time to create some Landscape
materials and use them in our landscape. I n Tutorial 7.3 w e will create a landscape
material and apply it to our landscape. We will then use the Paint m ode o f the
Landscape tool to paint this material onto our landscape to make it look better.
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.140.196.244