7
Terrains and Landscapes in
Unreal Engine
7.1 INTRO DUCTION TO LANDSCAPES
S
O far we have played mostly indoors! In almost all tutorials in this book, we first
set up a demo roo m with neat display items to showcase our creations and to
develop a p resentable set of displays. Now, it is time to go outside and have some
outdoors fun with Unreal Engine 4s brand new Landscapes!
In order to cr eate vast expanses of outdoor levels with high quality visuals we need to
fully utilize the power of landscapes in Unreal Engine 4. The good news is, creating,
manipulating and developing fantastic looking outd oors scenes is quite easy with the
landscape tools. Whether you want to crea te your landscape entirely in UE 4, or use
third party terrain tools such as World Ma chine, Terragen, Mudbox, or ZBrush, to
generate and imp ort height maps and terrains into Unreal, the results will be quite
impressive and the process fun.
In this chapter, m uch like all the other c hapters, I have tried to confine our learning
and exploration to Unreal Engine 4. As su ch, I tried to stay away from utilizing any
other software as much as possible. To this end, we will work entirely in Unr eal
Engine for the scope of our adventures into landscapes. Once you go through this
chapter and play with the Landscape editor in Unreal 4, and you would like to use
third party tools to create your own terrains and import them into Unreal Engine, you
will find the process quite straight forward.
So what exactly is a landscape? In Unreal Engine 4, a Landscape is pretty much the
equivalent o f a Terrain in UDK, Unr eal Eng ine 3, or othe r 3D game engines. Much
like terrains in UDK, a landscape in UE4 is an actor. It is used for the creation of vast
outdoors environments based on a height map. This actor enables you to develo p
high mountains and deep valleys, cave op enings, and even rivers a nd highways.
There is a significan t advantage in using a landscape instead of a static mesh with
the same number of vertices and polygo ns for terrain s. Unreal En gine has the ability
to utilize the landscape properties to automatically calculate the be st LOD (Level
of Details) based on the cam era’s distance from regions of the landscape that are
being rendered. This will dramatically decrease the demand on both CPU and GPU
operations to make vast terrains and landscapes render quite comfortably with real-
time performance.
The geometry of a landscape is contro lled form a map called a Heightmap. A
Heightmap is a black and white bitmap in which the dar ker areas represent lower
elevations, while brighter locations associate with higher elevations (see Figure 7.1).
The Heightmap sh own in Figure 7.1 corresponds to a raw landscape in Unrea l Eng ine
that looks like Figure 7.2. If the landscape looks bland and dull, it is because there
are not any landscape materials associated with it.
381
382 Game Development and Simulation with Unreal Technology
FIGURE 7.1: An Example of a H ei ghtmap.
We will learn, in this chapter, how to create landscape s and make landscape materials
to apply to our terrains. We will learn about how to blend different materia l networks
to apply and to paint on our land scape for grassy areas, rocky mountains, and snow-
capped mountains. We will also see how we can fill out landscapes with foliage
actors, and a unique and newly introduced toolkit for creating landscape splines in
our terrains.
7.2 LANDSCAPE SETUP
As I me ntion earlier, a landscape (or terrain) is an actor in Unreal Engine 4. Much
like any othe r actor, you c an create and place an instance of it in your level. Once a
landscape is created and placed in a level, you will notice two actor s in the Scene Out-
liner a Landscape Actor and a Landscape Gizmo Active Actor, hig hlighted
Terrains and Landscapes in Un real Engine 383
FIGURE 7.2: A Landscape Created from Heightmap in Figure 7.1.
in Figure 7.3(a).
(a) (b)
FIGURE 7.3: (a) Landscape Actor and Landscape Gizmo Actor. (b) Landscape Panel.
7.2.1 CREATING A LANDSCAPE
Creating a landscape is a very easy process. The mor e time-consuming process is to
edit the landscape, to set up its materials and layers, and to make it look realistic and
desirable.
To create a landscape, simply select the Landscape Tool of the Modes Panel (see
Figure 7.3(b)). The Landscape tool looks like a Mountain icon. You can also open
384 Game Development and Simulation with Unreal Technology
the Landscape tool by pressing Shit + 3 on your keyboard. Under the Landscape
Panel yo u will see three ta bs. These a re the modes of the landscape tool:
Manage: This tab has two main functionalities. The first is to create a la ndscape if
there is not one alrea dy created in your level. The second function is activated if
you select a Landscape Actor, and allows you to manage the landscape by edit-
ing its components. We will see this function later in this chapter (the left tab in
Figure 7.3(b)).
Sculpt: This tab is disabled if no landscape actor is pr esent in your map. Once a
landscape is cr eated an d selected in the ma p, this tab becomes active and gives
you a host of tools to “ sculpt” the lan dscape (the left middle in Figu re 7.3 (b)).
Paint: This tab is disabled if no landscape actor is present in your map. Once a
landscape is created and selected in the map, this tab becomes active and allows
you to paint la ndscape material on it (the right tab in Figure 7.3(b)).
There are two ways to create a landscape. The first way to cre ate a landscape is to
create one from scratch . In creating a blank landscape from scratch you will need
to click on the C reate New radio button in the Manage section of the landscape
panel. Before you cr eate a new landscape, you may assign a landscape material to it,
change its properties su ch as Section Size, Overall Resolution, etc. Once you
are happy with its primitive properties, either click on Fill World or Create buttons
to create the landscape.
The second way to create a new landscape is to import one from a Heightma p file. To
do this, click on the Import from File radio button in the Manage section of the
landscape button. This will take you to a ro llout that allows you to browse and select
a Heightmap file, choose the Heightmap resolution and apply a landscape material
to the landscape. You can also manage landscape properties such as Section Size,
Overall Resolution, etc. Once you ar e re ady to create the landscape, click on Fit
To Data o r Import buttons to cre ate the landscape.
NOTE
When importing a lan dscape from a Heightmap file, pay attention to the file
format. To avoid any unintended quality issues, make sur e the height map is
a 16-bit, gray scale, PNG file.
In both cases you will see a green wireframe of the impending landscape in the
viewport. Once yo u create the landscape by either method, the Sculpt and Paint
tabs will be activated and you can edit your la ndscape to create the outdoors look
you wish to a chieve.
Terrains and Landscapes in Un real Engine 385
7.2.2 THE LANDSCAPE MANAGE TAB (CREATION MODE)
As mentioned above, in the Landscape Manage Tab you can either create new land-
scape or edit existing landscape. Let us take a look in Table 7.1 at each property of
the New L andscape mode of the manage tab
1
[25]:
TABLE 7.1: Landscape Manage Tab Details
Create New: If selected, a new landscape will be created from scratch.
Import from File: If selected, a landscape will be created from a Heightma p
file.
Material: Allows you to assign a material to the landscape upo n creation.
Location: The location in the world where the landscape will be created.
Rotatio n: The rotation of the landscape in the world.
Scale: The lan d scape sc a le in the world.
Section Size: Section si ze is used for landscape LOD (Level of Detail) and
culling. Smaller sections make the landscape more aggressively utilize the
LOD of sections at the cost of CPU calculations. Using larger sections
will reduce the number of components, which in turn will result in less
CPU cost.
Section per Component: This property in tandem with section size deter-
mine the landscape’s LOD. Each section is the unit of the landscape
LOD. So a 2 × 2 secti on gives 4 different LODs at once. Larger section
sizes will allow for less CPU calculation time, but could result in too m a n y
draw calls on very large areas of landscape or on mobile devices [25].
Number of Components: Along with section size, this property sets the size
of your landscape. It is highly recommended not to exceed component
numbers of 32×32, a s l arge components could lead to performance issues.
Overall Resolution: Specifies the number of vertices in your landscape.
Fill World: Makes the landscape as big as pos sible i.e., ignores the set-
tings.
Create: Creates the landscape based o n settin g specified.
In Tutorial 7.1 you will create a landscape to get some experience with both me thods
of landscape creation. We will first create a blank landscape. Then, we will very
quickly modify it to create some elevation. After the landscape looks a bit less dull
1
The contents of this section are adopted from the official UE4 online documentation found at:
https://docs.unrealengine.com/latest/INT/.
..................Content has been hidden....................

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