416 Game Development and Simulation with Unreal Technology
FIGURE 7.24: Landscape Texture C olors Modified.
h. Your network should loo k similar to Figure 7.23(b).
56. Save and apply your m aterial.
57. Now, if you go back to the main editor, after the shaders co mpilation is finished,
your landscape should lo ok more natural as shown in Figure 7.24.
58. Only one last thing is left before we finish up this Landscape Material. The mate-
rial (especially on the sandy area looks too shiny!). Let us fix this issue next:
a. Go back to your material (Mat_LScape_Textured) in the material editor.
b. Duplicate the three Layer Weight expressions, th e GravelLayer,
GrassLayer, and the SnowLayer. To do this, marquee select (or control-
click) just the three Landscape Layer Weight exp ressions and then pr ess
Control+W.
c. Move them close to the roughness channel of the material node. Feel free to
re-arrange your n etwork if you need more room.
d. Create two Constant exp ressions to the left of the duplicate Layer Weight
expression.
e. In the de scription of one of the Constant expressions, type G rass
Roughness and change its R value to 1.0.
f. In the description of the second Constant expression, type Sn ow Roughness
and leave its R value to 0.25.
g. Connect the o utput of the Grass Roughness to the Layer channel of both
the G r avelLayer and the GrassLayer.
h. Connect the o utput of the Snow Roughness to the Layer channe l of the
SnowLayer.
Terrains and Landscapes in Un real Engine 417
i. Connect th e output of the SnowLayer to the Roughness channel of your
material node.
FIGURE 7.25: Landscape Texture Roughness Channel.
59. Now, your snow shou ld be glossy while sand and grass should loo k rough, just
the way it is supposed to be.
60. Feel f ree to make modifications to your landscape as you wish, to sculpt and paint
your lan dscape more , a nd see what the effect of our changes are on the look and
feel of y our landscape.
61. Save your level, ma te rials, and all your progr ess so far.
What Happened in TUTORIAL 7.4. . .
You just created a more detailed landscape material and applied its layers to your
landscape. We will go over what we did in the tutorial step by step.
DUPLICATING LANDSCAPE MATERIAL
In order to save ourselves some time, instead of re -creating a landscape material
from scratch, we duplicated our previous landscape material. Remember, that
material had three layers i.e., the GravelLayer, GrassLayer, and SnowLayer.
Those layers w ere being fed by a simple network that was made up from simple
Constant3Ve ctors.
In our duplicate material, we will keep the layers. However, we will replace
the Const3Vector Colors we use for the Gravel, Gr ass, and Snow co lors, we will
use textures.
SETTING UP LAYER NETWORKS
In this step of the tutorial, we c reated three Texture Sample expressions to re-
place our Gravel, Grass, and Snow layer material networks. The Starter Contents
of the UE4 engine comes will a lot of u seful textures.
We picked a T_Ground_Gravel_D texture (Figure 7.26(a )) for our sand (or
gravel) and a T_Ground_Gr ass_D texture (Figure 7.26(b)) for our grass land.
418 Game Development and Simulation with Unreal Technology
For the snowy areas we picked a T_Perlin_Noise_M texture (Figure 7.26(c)).
Let us see how these textures were used.
Notice the _D at the e nd of the texture file name. It stands for the diffuse (or
color) version of the texture. These textures also have an associated Normal Map
which is signified with the suffix _N as we will see a little later.
(a) (b) (c)
FIGURE 7.26: Texture Maps Used for the Landscape Material.
The networks for the gravel and grass materials are fairly simple. All we
needed to do was to c onnect the output of the gr avel and grass texture sample ex-
pression to the Layer channel of their respec tive la yer. We worked on the Snow
layer a bit differently.
Notice in Figure 7.26(c) that the texture look s noisy, br ight in some areas and
dark in other. This texture works perfectly if we combine it with a white color to
represent the uneven pattern of snowfall covering the ground. To achieve th is ef-
fect, we multiplied the noise texture with the Snow Color (R:0.75,G:0 .75,B:0.7 5)
and used this result as the Snow texture.
APPLYING LAND SCAPE MATERIAL
After using the texture ma ps for the g ravel and grass layers, and the combination
of a noise texture and a snow color for the snow layer we applied the ma te rial to
the Landscape Material of our Landscape acto r. We then started painting th e
layers in the Paint mode of the Landscape tool. Just like the previous Tutorial,
we had to create Layer Info assets to be able to paint the layer.
At this phase, we noticed that the textures were too small for our vast outdoors
envir onment. The tiling factors of our texture would make an enormous amount
of repetitions and c reated u ndesirable wallflower like patterns in the regions afar
from the viewer.
USING TEXTURE COORDINATES
The fix to the tiling artifacts on our landscape was fairly easy. It turns out that
we could use a special Landscape Material Expression called Landscape Layer
Coord to change the tiling scale of our textures. Applying a tiling scale of 5
Terrains and Landscapes in Un real Engine 419
or 7 would actually multiply our original texture UV coordinates by this larger
number and would be suitable for this situation .
However, we are not done yet! Applying a tiling scale fixed the issue of visual
look of our landscape from far away. Looking c losely at the landscape reveals
another issue with our material that was yet to be addressed.
Lookin g closer, we noticed that the textures look like paint. There was not
any depth to the materia ls on our landscape. It looks as if someb ody just took
a bucket of pa int and painted those flat textures on the landscape. We fixed this
issue with the use of Normal Ma ps n ext.
SETTING UP NORMAL CHANNEL
The most impo rtant thing to keep in mind, when setting up our n etwork for the
normal channel of our landscap e materia l, is to use a similar layer blen ding me ch-
anism. For this reaso n, we duplicated the three Layer Blend expressions for the
GravelLayer, G rassLayer and SnowL ayer material layers to apply to our ma-
terial’s n ormal channel.
Once the duplicate Layer Weight expressions were created, we created two
Texture Sample expressions to host our normal maps. The Gr avel Normal
Texture expression was given the T_Ground_Grav el_N and the Grass Normal
Texture exp ression was filled w ith the T_G round_Grass_N. Notice the suffix
_N for these texture maps in the Content Browser . Although technically it does
not do anything, the artists named the textures with _N to help us notice their
functions.
Now, let us take a look at the network setup. If you check out the normal
channel’s network in Figure 7.21 you will see that we applied the RGBA output
of the Gravel Normal Texture to the Layer channels of both the GravelLayer
and the SnowLayer. By doing this, we basically a pplied the same depth (via
normal maps) to the snow and gr avel.
This will give us the option of having gravel (with the gravel colo r and depth
patterns) or snow (with the snow color but with gravel depth pattern). So for
those areas that are snowy, it will loo k as though the snow is covering the gravels
underneath. The case for the grass normal was easily done. We just applied the
RGBA output channel of th e grass normal map to th e Layer input chan nel of its
layer.
FINAL TOUCHES TO THE LANDSCAPE MATERIAL
So far our material looks pretty good, and has some depth to it when applied
to the landscape . However, some parts of the landscape look too glossy for the
type of material applied. For example, the grass and parts of the sand (gravel)
look like plastic. The problem is that the roughness channel of our material is
left unconnected.
In UE4, the new material system is modeled after physically based materials.
To represent d ifferent kinds of materials efficiently, UE4 materials make use of
specialized channels such as Metallic and Roughness. The Roughness chan-
420 Game Development and Simulation with Unreal Technology
FIGURE 7.27: The Final Look of Textured Landscape Material.
nel allows the material to have varying degrees of smoothness (or roughness)
to them. Smooth materials (e.g., plastic) re flect light back more perfectly than
rough materials (e.g., cloth).
To this end, we want our gravel and grassy areas of the landscape to be more
rough than those where there is snow on the ground. We achieved this look by
duplicating our three Layer Blend expressions, and applying a value of 1 to the
Gravel and Grass layers and a value of 0 .25 to the Snow Layer. The output of
this network was then co nnected to the Roughness channel of our m aterial.
Fantastic! Our landscape looks p retty great as we created a rela tively professional
looking landscape with fairly little time and simple material networks. N ext, we will
take a look at a special expression ca lled, Landscape Visibility Mask. This ex-
pression allows us to mask the visibility of our landscape material when applied to
certain locations to create things like cave openings and holes in our landscape.
NOTE
If you use the Visibility tool without having a Landscape Hole Materia l as-
signed, the Visibility tool will remove the Material layers applied to the se-
lected sections, but will not create a hole in the Landscape itself [30].
..................Content has been hidden....................

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