Materials in Unreal Engine 179
a link between a material a nd the geometry on which it is applied. Not o nly will
you have the c ontrol over the ligh t interactions with your object, but you will
also have control of its geometry with the world displacement.
Remember from our discussion of the normal maps and the way normal chan-
nel contro ls the reflec tion of lig ht on a surface to simulate depth, when it is
not there. There are two ways to have a material affect the geometry. The first
is through the world p osition offset channel of the material, an d the second is
through the world displacement channel and tessellation multiplier.
In this tutorial we worked with the world displacement channel to pull some
vertices outwards and push other in, to create real depth.
CREATING TH E WORLD DISPLACEMENT NETWORK
The first thing to remember about the world displacement in UE4 is that this
feature is only available if the hardware supports DX11. If your hardware does
not suppo rt DX11, you cannot use the Te ssellation features that enable the world
displacement. In such cases, you still c an use the wor ld po sition offset channel
of your material to affect geometry.
To enable the world displacement, we first selected the material node and un-
der its details rollout, change d the Tessellation mode to D 3D11 Tessellation
Mode. Once the Tessellation mode is set to anything other than None, your mate -
rial node’s World Displacem ent and Tessellation Mult iplier channels
will become a ctivated.
Both the World Displacement and Tessellation Multiplier channels
work with the geometry’s vertice s. As such, we usually use a Vertex Normal
WS expression in the network that w ill be used to supply these channels. The
Vertex Normal WS will give us the n ormal vector of each vertex in the world
space.
Remember the normal vector is the vector perp endicular to the surface at any
given location. Therefore, having the normal vector at each vertex, we can push
and pull it with the World Displacement channel. This is exactly what we
did in our network. We used the green channel of th e T_Brick_Hewn _Stone_M
texture. This channel has larger values for the brick locations and lower values for
the grout location. We then multiplied the output of this channel by the Vertex
Normal WS to pull the object’s vertices. Sinc e the brick values are more than
the grout values, the vertices located on the bricks are pulled out mor e than tho se
on the group. This will make our object have real depth compared to what is
possible with only the nor mal channel.
In the previous series of tu torials, we started by working with a simple material
off of a texture map, and worked our way towards making this ma te rial look very
realistic. In fact, you just created your first advanced material u sin g Unr eal Material
Editor! We populated our demo room with these materials to showcase your progre ss
and the power of Unreal Engine.