220 Game Development and Simulation with Unreal Technology
Period: 10.0
52. Place a OneMinus expression above the Sine expression and make the following
connection:
Panner output Fire Texture UVs chan n e l.
Fire Texture RGB (white ) outpu t O neMinus in p u t channe l.
53. Place a Multiply to the right of the OneMinus expression and make the following
changes to its de ta ils rollout:
Description: Ice Multiply
54.
Place another Multiply just above the first one (the one named Ice Multiply) and
make the following chang es to its deta ils rollout:
Description: Fire Multiply
55.
Make the following co nnections:
Fire Texture RGB (white ) outpu t B ch a n n e l of Fire Multiply.
OneMinus output B channel of Ice Multiply.
Hex Tile Mask’s Green channel A channel of Fire Multiply.
Hex Tile Mask’s Green channel A channel of Ice Mu ltiply.
56. Place a ConstantBiasScale expression below the two Multiply expressions,
connect the output of the Sine expression to its input and make sure its properties
in its default rollout are as follows:
Bias: 1.0
Scale: 0.5
57. Place a Lerp expression to the right of the two Multiply and the ConstantBi-
asScale expressions and make the following connections:
Fire Multiply output A channel of Lerp.
Ice Multiply o u tp u t B channel of Lerp.
ConstantB iasScale output Alpha c h a n n e l of Lerp.
Lerp output cha n n e l Emissive Color channel of the material.
58. Comment this network as Tiles Emissive Network.
59. Save your material. The material ne twork connection should look similar to Fig-
ure 4.69(a). Notice: the metal tiles seem to rotate aroun d the object’s center and
around its main axes (Figure 4.69(b ) and Figure 4.69(c)).
Materials in Unreal Engine 221
(a)
(b) (c)
FIGURE 4.69: The Dynamic Panels with Pulsation N et work and Material.
APPLYING MATERIALS TO THE PROPS
Now with our three materials (M_Pan els_Static, M_Panels _Dynamic, and
M_Panels_Dynamic_F lames) c reated, we can apply them on the props we
placed in the display item of the demo ro om. But first, w e need a light close
to where the props are located, so we could see the effect a little more clearly.
60. Left-click o n the leftmost object to select it.
61. Go to your MyMaterials folder in whic h you created the three materials.
62. Find the M_ Panels_Static mater ia l and select it.
63. Drag the M_Panels_Static mate rial into the Element 0 of the Materials sec-
tion of the Details rollout of the static m esh actor selected in the scene.
64. Left-click o n the middle object to select it.
65. Go to your MyMaterials folder in whic h you created the three materials.
66. Find the M_ Panels_Dynamic ma te rial and select it.
67. Drag the M_Panels_Dynamic material into the Element 0 of the Materials sec-
tion of the Details rollout of the static m esh actor selected in the scene.
222 Game Development and Simulation with Unreal Technology
(a)
(b)
FIGURE 4.70: The three material s from left: M_Panels_Static, M_Panels_Dynamic, and
M_Panels_Dynamic_Flames applied to the props.
68. Left-cli ck on the rightm ost object to select it.
69. Go to your MyMaterials folder in which you created the th ree materia ls.
70. Find the M_Panels_Dynamic_Flames mate rial and select it.
71. Drag the M_Panels_Dy namic_Flames material into the Element 0 of the Ma-
terials section of the Details rollout of th e static mesh actor selected in the scene.
72. Your scene and the materials applied to static mesh actors within it should look
similar to Figure 4.70.
Making textures move along our material was quite easy! All we needed was a
coordinate expression called Panner. A Panner expression will modify our texture
UV coordinates by moving them at a constant speed of (SpeedX,SpeedY).
Materials in Unreal Engine 223
However, we must be careful to apply this Panner coordinate exp ression to the
UVs chan nel of all of the texture expressions we are using in our material. Otherwise,
you w ill see par ts of the material’s look stay static while others move.
To create the pulsation look, we also used a dynamic e ffect. This time, we used a
Sine expression with its input connected to a Time expression in a Lerp network to
pick the emissive color of our grout to range from flam e to ice.
What Happened in TUTORIAL 4.6. . .
In this tutorial, we cr eated three materials: a simple but static Steel Tile material,
a dynamic version of it that seems to rotate on the surface of the o bject to which it
will be applied, and a time varying version that makes the grout oscillate between
ice cold, to fiery hot.
ORGANIZING ASSETS AND PLACING THE DISPLAY ITEM
Like all other tuto rials in this chapter so far, we started with creating a display
item and organizing our materials into our own material folder.
CREATING TH E BASE MATERIAL’S DIFFUSE NETWORK
For this material’s base network, I wanted to show you how we can use masking
in conjunction with the idea of Physically Based Materials in Unreal Engine
4 to simplify our material networks. To do so, we used two different sets of
textures.
(a) (b)
FIGURE 4.71: Steel Material with and w ithout Masking.
The first set was our usua l color and normal textures f or the base material. We
used a steel diffuse texture for the color and a steel normal texture for its normal.
However, simply applying these two textures to our Ba se Color and Normal
channels would not result in a tiled look that we wanted to achieve.
Figure 4.71 shows what will happen if we do not use a mask to create the
tiles’ look. The material in Figure 4.71(a) is simply using a diffuse and normal
224 Game Development and Simulation with Unreal Technology
steel texture. Using a tile mask, we could augment the material to look much
more sophisticated as shown in Fig ure 4.71(b). So how exactly did we achieve
the look in Figure 4.71(b)?
A closer in spection of a texture from th e Starter Contents called
T_Tech_Hex_Tile_M (Fig ure 4.72) reveals a very interesting pattern. We
can use these pa tterns as masks to achieve ou r desired look on the ma te rial.
(a) (b) (c)
FIGURE 4.72: (a) The Red Channel. (b) The Green Channel. (c) The Blue Channel.
Multiplying the red channel of the T _ Tech_Hex_Tile_M texture (shown
in Figure 4.72(a)) with any color (or texture) w ill result in a hexagonal tiled
pattern. Each hexagonal tile will have a brighter version of the multiplied color
(or texture) and the boundaries between tiles a darker color.
The green channel of the T_Tech_Hex_Tile_M texture (shown in Fig-
ure 4.72(b)) matches the hexagonal pattern, with each hexagon represen te d with
the black color, and the areas between hexagons with a white color. Using this
channel as a selector (or switch) between a metallic/no n-metallic and between
rough/glossy features will re sult in the desired look of our materials.
We wanted the tiles to be non-metallic while the grout to have a metallic look.
To achieve this effect, we used two linear interpolation (Lerp) expressions. We
connected the green channel of our mast texture to the Alpha channel of the
Lerp expressions to interp olate between the values of 0 and 1 for the Metallic
and Roughness channels of our material.
CREATING TH E BASE MATERIAL’S NORMAL NETWORK
To give some three-dimensionality to our material, w e are using the normal chan-
nel. We have two normal textures to use for this material. The base ma te rial is
of steel. Therefore, we used a normal map for a steel material to give the overall
look of the small p ores you would usually see on steel. We also have the mate-
rial sectioned into hexagonal tiles. We used the normal map associated with the
hexagonal tiles to create the 3D feel of our tiled material. We combined these
two textures by simply adding them to each other.
..................Content has been hidden....................

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