496 Game Development and Simulation with Unreal Technology
the level. The Reflection Ca pture acto r will rec eive indire ct and static lighting
from the scene and create a cubemap for the reflections to be projecte d onto
parts of the scene that receive re flection (i.e., parts of the scene that are within
the actor’s area of influence). We placed a Sphere Reflection Captu r e actor
close to the surface of the river and made its area of influence large enough to
affect the entire river.
Once the Reflection Cap ture actor was set up in the scene, we changed the
roughness of our water material to 0. This change makes the water material very
reflective. The material is already set up to be fully metallic, so the specularity
of our material is taken care of.
The next step was to make the water surface a little translucent. To do so, we
first changed our material’s Blend Mode to be Translucent. With the Blend
Mode set to Translucent, two changes becom e apparent. First, the Opacity chan -
nel of the m aterial node will become active to rece ive opacity values. Second,
you w ill be able to set up your ma te rial’s Translucency prop erties.
We changed the Translucency Lighting Mode of our material to TLM
Surface. This is the preferred Translucency Lighting Mode for water and glass
surfaces. We established o ur material’s Opac ity chan nel. We could have sim-
ply created a constant value (e.g., 0.95) and plugged it directly to the Opacity
channel of our material node. However, I wanted to ach ieve a more profound
water-like look.
In our level we have a very large area of water (i.e., the river flowing throug h
a valley). As such when you look at the river surface, there are some areas where
your view angle is large (i.e., close to where you are located), while within the
same view there are water areas where your view angle is small (i.e., at the
horizon). When you loo k at a water surface dead-on, it looks more transparent,
while looking at it from an angle makes it look more opaque .
To achieve this effect, I used a Fresnel expression whose normal value is
being supplied from the normal of our water surface. This expression gives us
a value ranging from 0 to 1 based on the angle at which we are viewing the
surface. I used the output of the Fresnel expression to interpolate between an
opacity valu e of 0.95 (slightly transparent) to 1 (completely opaque), depen ding
on whether w e are looking at th e water straigh t-on or at an angle, respectively.
I finally connected a fraction of the water Base Color to the Emiss ive Color
channel of the water material to make it look a bit shiny.
UNDERWATER BLUR EFFECT
The fina l effect to add to ou r la ndscape was to simulate the blurriness of the un-
derwater areas. This effect can be achieved by placing a Post-Process Volume
into our level, a ligning it with the water surface, and modifying its properties to
create a murky blue tint and to simulate the depth of field.
Post-Process Volume actors are proc esses in the fra gment shader, and as
such they will not really receive information or interact with th e geometry o f
the level. In other words, these volumes work by modify ing the final look of the
Terrains and Landscapes in Un real Engine 497
pixels at render time. As such, they are powerful tools to create after-effects, such
as Auto Exposur e, Lens Flare, Bloom, Motion Blur, Depth of Field, etc.
In our level, we needed two of these features: a Tint to make the underwater
area have a blue tint, and a Depth of Field to make un derwater scenes fuzzy.
To achieve this effect, we gave the Post-Process Volume a tint with a color
value of (R:0.2, G:0.4 , B:0.95, A:1). For the Depth of Field values, I used
Gaussian as the filtering method w ith Near Transiti on Region o f 3000, and
Far Transi tion Region of 50 00. This will make the areas start becoming
blurry from a few thousand world units in front of the camera.
7.8 SUMMARY
In th is chapter we worked with a newly introduced system in Unreal Engine 4, called
Landscape. Landscape s are the equivalent of Terrains in other 3D game engines and
are quite useful in efficiently desig ning and rendering outdoor environments.
Much like other chapters in this book, we first learned about the features and fu nction-
alities of the engine compone nt–in this case, landscap e tools. We then went through
a series of Tutorials aimed to help us learn how to work with landscapes in Unreal
Engine 4 in a progressive manner.
In particula r, we learn ed about all of th e tools a nd mode s that the Landscape Tool
affords us an d about their usage and functionalities. We also looked at two important
tools in UE4 that work well in tandem with landscapes, the Landscape Spline Tool
and the Foliage System.
We learned how to add, edit and man age splines in our landscapes to cre ate linear
features that con form to the shape of th e terrain, such as roads, river banks, etc. We
also worked with the Foliage System in UE4 and learned how to fully utilize this
system to populate our level with static mesh instances.
We discovered the benefits of utilizing foliage instanced meshes in efficiently ren-
dering large numbers of such instances by means of clustering and culling. We also
learned abou t setting up culling and fading support in the materials of our instanced
meshes.
The chapter conclud ed with a complete c overage of creating and integrating mas-
sive reflective and translucent materials such as a river, lake or ocean surfaces into a
landscape. We discussed the use of Textu re Co ordinate systems for tiling, panning,
and combining dynamic lo oks for our water su rfaces. We also le arned about properly
setting up reflections and translucency for water surfaces. We finished our outdoors
journey by creating a Post-Process Volume to create an underwater effect for under-
water areas in our landscape.
7.9 EXERCISES
Exercise 1. The Gra nd Canyon:
a) Use the Landscape Tool to create a rendition of the Grand
498 Game Development and Simulation with Unreal Technology
Canyon. Search for an aerial view of the Grand Canyon for
your reference. For this exercise our goal is the ge ometry of the
canyon, so do not worry about setting up materials or any effect.
You may find a few Web addresses where you may be able to find
suitable areal photos:
http://www.nps.gov/grca/photosmultimedia/
https://www.flickr.com/photos/grand_canyon_
nps/
b) Use the techniques you learne d in this chapter to set up Land-
scape Materials, create a mate rial for the view of the Grand
Canyon you created in Exercise 1.a) and apply your materials
to the landscape.
c) It usually does not snow in the Grand Canyon. However, to make
your canyon “unreal”, ad d a snow laye r to the landscape material
you created in Exercise 1.b) and apply some of the snow to the
high e levations in the canyon.
d) Either create a few static meshes that you should usually find
in the Grand Canyon, or use some of the already c reated meshes
within different UE4 content projects to populate y our landscape.
e) Edit materials used for the foliage instanced meshes from Exer-
cise 1 .d) to create Culling and Fading support wh en used in the
landscape.
f) Create a highway that passes through th e canyon.
Exercise 2. Water Materials:
a) In Tutorial 7.9 we used a copy of the M_Water_Lake material
from the starter contents. Modif y this m aterial so that it does not
use Metallic channel, bu t is still perfectly reflective.
b) In the Linear Interpolation network for the Macro Normal sec-
tion of the water material in Tutorial 7.9, what is the minimum
view distance that starts the ble nding of the Macro Normals?
c) In the Linear Interpo la tion network for the Macro Normal sec-
tion of the water material in Tutorial 7.9, what is the resolution
of the b le nding of the two normal channels?
Exercise 3. Underwater Scenes:
a) We used a Post-Process Volume for the underwater effects in Tu-
torial 7.9. Use this volume to create lens effects.
b) Create the so-called God Rays with a post-process volume.
c) Add a volume (you will have to find out what kind) to crea te the
effect of buoyancy i.e., when the player su bmerges in the water,
the water should create a push to floa t the player.
..................Content has been hidden....................

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