150 Game Development and Simulation with Unreal Technology
drawn on that location. The end result of any calculation that describes the colo rs at
each pixel is stored in the fr ame buffer.
The blend mode of a material tells the engine how to include the results of the
material calc ulations for each pixel with the destination color already in the f rame
buffer. Unreal Engine has five available Blend Modes. Table 4.6 shows a brief
description of each model.
CROSS-REFERENCE
To learn more about Material Blend Modes, please check out Section 5.3
on page 271 of Chapter 5– Advanced Material Concepts in Unreal Engine.
Now that we have covered some basics of what materials are in UE4 and got a
quick overview of the Material Editor in Unreal Engine 4, let us make a couple of
basic materials. In the next few tutorials, we will go over the creation of a number of
materials based on the physically based shading models. But first, in Tutorial 4.1 we
will set up our project and migrate some assets to be able to showcase our work.
FIND ON THE WEBSITE
To find updates to this tutorial and upda te d instructions about its implementa-
tion on othe r UE4 versions, p le ase visit the books companion Website at:
http://www.RVRLAB.com/UE4Book/
TUTORIAL 4.1 Creating a Project and Migrating Contents
CREATE A BLANK PROJECT
In this tutorial we will set up an empty project and migrate the contents of
the Demo Room from the Unreal Engine’s Example Con tents p roject into
it. The first thing to do is to create a p roject to which we will add the Demo
Room. We will select the Include starter content to have access to starter
contents (see Fig ure 4.24).
1. Open the Unreal Launcher and select the version of the engine you would like to
work with. The following tutorial is crea te d with Unreal Engine 4.5.1.
2. Once the La uncher Opens, choose New Project (see Figure 4.24).
3. Select the B lueprint as y our proje ct type, and make sure that the Bla nk is se-
lected.
Materials in Unreal Engine 151
FIGURE 4.24: Creating a Blank Project for Material Tutorials.
4. Select your platform (Desktop/Console) and your graphics qua lity.
5. Make sure you include the starter content (see Figure 4.24) .
6. Give your project a name and click Create Project.
After you created this blank project, you w ill close the pro je ct and open the
Content Examples projects. There is a f older in this project that contains the
contents of a Demo Room.
MIGRATING CONTE NT FROM UNREAL PROJECTS
In this section we will migrate the Demo Room c ontents from the Content
Example project into our own project to be able to set up a nice environment
to visualize the effects we create.
7. If y ou have not downloaded the Content Examples from the Unreal Market-
place, use th e Unreal Engine Launche r to download the Content Examp le s. This
item comes with your Unreal Eng ine 4 subscription and contains several useful
maps and examples for you to exp lore and use in your pr ojects free of charge.
8. Open the Content Examples project from the Unreal Engine Launcher (Fig-
ure 4.25(a)).
9. In the Content Browser of the Content Examples project, right-click on the
Demo Room Folder, and choo se Migrate (Figure 4 .25(b)).
152 Game Development and Simulation with Unreal Technology
(a) (b) (c)
FIGURE 4.25: (a) Opening the Content Examples. (b) Migrating the Demo Room. (c) Choos-
ing the destination for Demo Room i n our MyMaterialsProject project.
10. The Asset Report window pops open, informing you which assets w ithin the
Demo Room folder will be exported to a new lo cation. These assets include, Tex-
tures, Blueprints, Materia ls, Meshes, etc. Select OK to proceed.
11. From the Windows Explorer window that opens, navigate to the location o f
the MyMaterialsProject project you created ear lier in this tutorial (Fig-
ure 4.25(c)). Select th e Content subfolde r of your pro je ct. De pending on how
your Un real Engine is set up, this location should be in My Documents/Unreal
Projects/MyMateria lsPro ject/Content folder.
12. Close the Contents Example project.
(a) (b)
FIGURE 4.26: (a) Creating an Empty Level. (b) Adding the Demo Room to the L evel.
SETTING UP YOUR DEMO ROOM
Now we will add a new map to our project to host a display room.
Materials in Unreal Engine 153
13. Open up the proje ct you created earlier on page 150 (earlier, I called this project
“MyMaterialsProjec t” ).
14. Now, let us add a new empty level to this proje ct. Click on File->New Level
and choose Empty Level (Figure 4.26(a )).
15. Go to the DemoRoom /BluePrint folder by double- clicking on DemoRoom
folder and then on BluePrint folder.
16. Drag the BP_DemoRoom blueprint into your level (Figure 4.26(b)).
17. Wait for the Unreal Engine to compile the shaders and build the materials.
18. Click o n Build from the Unreal toolbar to build the lighting (this may take a
few minutes depending on your machine).
(a) (b) (c)
FIGURE 4.27: (a) Demo Room. (b) Demo Room Properties. (c) Additional Room Properties.
19. Now that you have the Demo Room created, you can explore its options. We
will be using this room throughout th is book to deploy the contents and materials
we create.
20. Save your level in the Maps folder of your Unreal project and give it a name such
as DisplayRoomLevel.
CROSS-REFERENCE
To learn a bout Blueprints in UE4, check out Chapter 3– Unreal Vi-
sual Scripting with Blueprints, and Chapter 8– Advanced Blueprint
Concepts.
OVERVIEW AND SETTING UP A D ISPLAY
Now that we have our level created and the Demo Room added to our level, we
will set up a couple of display items to showcase our creations.
154 Game Development and Simulation with Unreal Technology
Just like the Demo Room object, the Display Item is a Blueprint. This
means that this object is a class with meshes, compon ents, and o ther pr operties,
as well as functiona lities that can b e utilized to configure it and to make it inter-
act with the world and players. Blueprints are very important co mponents of the
Unreal Engine 4. In fact, the con cept of Blueprints is the major item introduced
with the release of the Unreal Engine 4.
To create a display item, perform the following steps:
(a) (b)
FIGURE 4.28: Adding a Demo Display Item to the Demo Room in the Map: (a) The Demo
Display Item. (b) The Display Properties.
TABLE 4.7
Description of Display Item Properties
Category Property Description/ Values
Properties
Type Round, SquareL, RoomL, DescriptionOnly, SquareLFlatWall
Text If Checked, Toggles Display Item Text Description
Back Color Changes the Color of the Display Item Walls
Text
Number This Text will Show as Label of the Display Item
Description This Text Will Show as the Title of the Display Item
Desc. 2nd Line Subtitle of the Display Item
Transform Scales the Title of the Display Item
21. Now that we have the d emo room set up, let us add a display. Navigate to
the BluePrint folder of the DemoRoom folder of your project. Locate the
BP_DemoDisplay blueprint into the demo room ( Figure 4.28(a)).
..................Content has been hidden....................

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