Chapter 8. Populating the World

Getting content into your Level is straightforward and artist friendly. The UE4 Editor offers many tools and features to help you place, modify, and organize your Assets in 3D space. In this chapter, you use the already-built Starter Content Assets you included with your project to build a simple Level in which to walk around.

Making and Saving a New, Blank Level

In my opinion, starting with a new Level and building a Level from scratch is the best way to get the desired results. Visualizations have different goals than most games, and most of the templates available just aren’t suited for the types of interactions needed when making interactive visualizations.

In the File menu, select New Level and select the Empty Level option.

Save your Level by selecting Save Current from the File menu or by clicking the Save Current button in the toolbar. When the Save Level As dialog (see Figure 8.1) appears, name the Level MyFirstMap and click Save to save the map to disk.

Image

Figure 8.1 Save Level As dialog

As you can see in this example, I created a folder at the root of the Content directory called Example1. You can create a new folder by right-clicking in various logical places in the Content Browser or by using the Add New button in the Content Browser. Remember that you can and should do all of your file management from within the Content Browser.

If you make a mistake and need to rename your map or the folder, you can use the right-click menu or by selecting the Asset or folder and pressing F2 on your keyboard.

Making a project-specific directory within the Content folder is a common practice in UE4, because it ensures all content created for this project is self-contained within its own directory, while content from third parties or other projects can be merged into your project without fear that the two will conflict.

Remember that Levels and maps are the same thing and the terms are used interchangeably to represent UMAP files.

Placing and Modifying Assets

The most common method for getting Assets from the Content Browser into the Level is simply to drag and drop the Asset(s) from the Content Browser into the Viewport in the Editor (see Figure 8.2).

Image

Figure 8.2 Dragging and dropping from Content Browser to the Level

Moving, Scaling, and Rotating

After placing the Actors, you can easily move, scale, and rotate them using familiar gizmos. You can easily switch between Move, Rotate, and Scale modes using the spacebar or the icons at the top of the Viewport.


Note

You can also use the W, E, and R keys to switch between Move, Scale, and Rotate, or press the spacebar to cycle through each of the modes.


Using the Details Panel

The Details Panel is where all the properties for each selected Actor display (see Figure 8.3). Here, you can directly set the Location, Scale, and Rotation properties for Actors along with the Class-specific settings such as Lightmap Resolution, Shadow options, and Material assignment overrides.

Image

Figure 8.3 Details Panel for a selected Static Mesh Actor

Snapping

The Assets in the Starter Content are built with a grid size of 100 units. For this reason, enabling Snap in the Viewport and setting it to 100 units is a good idea. That way, when you move Actors around, they snap to a 100 x 100 x100 unit grid.

You can also set snapping for Rotation and Scale in the Viewport settings using toggle buttons located in the upper right of each Viewport (see Figure 8.4). Each displays the snapping interval to the right. You can adjust this setting by clicking on the interval.

Image

Figure 8.4 Snap options in each Viewport

Duplicating

You have several ways to duplicate Actors. Doing a Copy-paste or using the Duplicate command in the right-click and Edit menus are good options.

I often use the keyboard shortcut Alt+Drag to instantly create copies of the selected object. Hold Shift while you duplicate an Actor to have the camera follow the Actor as you move it. You can also Alt+Drag multiple Actors at once. You need to grab onto the transform gizmo in the Viewport to do this, not just anywhere on the model. You can also clone Actors like this with the rotate and scale gizmos as well.

Adding Actors from the Class Browser

The Content Browser is for placing generated or imported content into the Level, but you will place many things into your game worlds that are not available in the Content Browser.

You place Classes such as Lights by dragging and dropping them from the Class Browser using Place Mode. Both methods create a new Level Actor that instantiates from the Class selected.

The Modes window is located in the upper left of the default Editor layout. You can also reveal the Class Browser by going to Window in the menu bar and selecting Modes.

The first tab in the Modes Panel is the Place Mode. The Place Mode contains the Class Browser.

Let there Be Light

Before you can start placing Actors in earnest, you need some light in the scene. Unlike in Max or Maya, there isn’t a built-in default scene or Viewport light. You must author the lighting systems manually.

If no lights are in your scene it will use the Unlit view mode. This view mode only displays the unshaded Base Color of the objects. This is workable, but ultimately difficult to work with in the long term because you cannot easily see depth, and objects tend to blend together.

UE4 boasts great real-time lighting and shadows. Whether you’re using Lightmass for high-performance, static GI lighting or using the dynamic shadows and lighting systems for direct lighting, a couple key lighting Actors are essential to achieving the best results from UE4.

Sun

For your sun, let’s use a Directional Light Actor. To add it, use the Modes Panel and switch to Place Mode (Shift+1). Click on Lights and drag a Directional Light into the scene.

Set the sun to Moveable in the Details Panel. This allows it to move and change properties dynamically and forces it to use dynamic shadows.

In most architectural visualizations, you would use static lighting with Lightmass, but I get into that topic in the next section. For now, focus on the basics. Dynamic lighting offers a fast, easy-to-edit WYSIWYG way to experiment and learn without the complexities of Lightmass.

Atmospheric Fog

UE4 includes atmospheric fog simulation, or a mathematical way of shading the sky and attenuating and tinting light over long distances. This is akin to the effect of purple mountains’ majesty when viewed from miles away as light is scattered in the atmosphere.

You place the Atmospheric Fog Actor like the Directional Light, using the Place Mode.

As soon as you drop the Fog Actor into the scene, a basic sky and horizon immediately generate, and if you’re facing the right way you’ll see a sun disk (see Figure 8.7, later in this chapter).

Right now, you’ll note that the sun is at the wrong location and the sky looks as if the sun is setting. You can either set up the sun position and sky colors manually or you can assign your Directional Sun Light to define these settings, giving you a nice dynamic sky.

Assign the Sun to the Atmosphere

You must manually define what Directional Light Actor is being used to determine the sky colors. You do this in the Directional Light Actor’s Properties with the Atmosphere Sun Light checkbox (see Figure 8.5).

Image

Figure 8.5 Directional Light details with the advanced properties displayed and Atmosphere Sun Light set to true

This checkbox is slightly hidden in the advanced properties of the Light Actor. To access it, select the small downward arrow in the Light properties in the Details Panel (see Figure 8.5). You can also use the search bar in the Details Panel to quickly filter the properties list (see Figure 8.6).

Image

Figure 8.6 Directional light details filtered using the search bar

Sky Light

The Sky Light Actor is the third and final Actor you need to add. This Actor captures an HDR cube map of the scene or uses a defined HDR CubeMap Texture to light the scene.

After you add this Actor, set the Mobility to Moveable. Your shadowed areas should fill with blue color from the sky. If it’s too bright, turn down the Intensity of the SkyLight.

Your scene should look a bit more like what’s shown in Figure 8.7. The Directional Light, Sky Light, and Atmospheric Fog Actors are each set to Moveable to use the dynamic lighting pipeline. The Editor layout has been customized to allow for a larger Viewport and more room to modify the properties.

Image

Figure 8.7 Basic scene lighting with a Directional Light, Sky Light, and Atmospheric Fog Actors

Moving Around the Scene

Now that there’s something in your scene, you’ll probably want to move and orbit your view a bit to take a look around.

UE4 features a great combination of Viewport navigation methods derived from both games and 3D design applications.

Game Style

The most common way to move around the scene is to use the game-style navigation system.

Holding down the right mouse button in the Viewport enables Game Navigation Mode. Dragging your mouse around (while still holding down the RMB) rotates your view. Pressing W on the keyboard moves you forward and S moves you back; pressing A and D moves you left and right, respectively.

You can also move up and down with the E and Q keys.

To adjust your movement speed, you can use the mouse wheel to speed up and slow down how fast you move around the Level.

Object Focused

You can also focus the camera on any Actor (or group of selected Actors) using the F keyboard shortcut. This key centers and zooms the camera to the selected objects. When it does, you can orbit around the selected Actors by holding down Alt and dragging with the left mouse button.

The orbit view is great for inspecting objects in the 3D view.

You can easily zoom in and out on the focused Actors by using the scroll wheel on your mouse (this time without holding down the right mouse button).

Building the Architecture

Using the various Static Meshes in the Architecture folder in the Starter Content, let’s build a simple apartment or house.

If you have Snapping on, set your interval for 100 units. This makes each Mesh in this folder snap into the scene like building blocks.

You’ll need a floor, some walls, and whatever else you come up with; have some fun.

Be sure there’s a door that connects rooms and some room to walk around. Each floor piece is 400cm x 400cm so each room should be at least 2 x 2.

Figure 8.8 shows what I came up with after having some fun putting together a bunch of blocks. I tried to make something that would contain the player in a small area but be open enough to explore. It only uses the walls and floor Static Meshes from the Starter Content snapped to the 100 x 100 grid. I have exposed the Orthographic Viewports using the Maximize/Minimize button in the upper-right corner of each Viewport. I’ve also set up a second Perspective view allowing me to see the scene from several 3D views.

Image

Figure 8.8 House floating in the endless void

Your area certainly doesn’t need to be as complex or could be much more complex—it’s up to you. However, make sure you have a floor for your Player to stand on and some walls so they can’t walk off into the void.

Adding Details to Your Structure

Now that you have a structure, let’s get some details into it. Let’s place some Static Mesh Actors from the Content Browser then add some Spot Light Actors with Lighting profiles and various colors to add some fun lighting effects.

Placing Props

Props are the Static Mesh Actors in your scene that make up the decorations and other non-architectural elements. The Sample Content comes with a good selection of Meshes to play with.

Like all other Meshes, simply drag and drop them from the Content Browser to place the first one in your Level. Copy and paste, and then move and scale to taste.

You can also place Materials and Particle Systems in your Level. Go nuts, keep it minimal—it’s up to you. All you really need are a floor and some walls; the rest is up to your imagination.

Here’s what I came up with after a few more minutes dragging-dropping, copying-pasting, surface snapping, and dragging-cloning (see Figure 8.9). I spent some time making my floating house a home by placing various props from the Content Browser, and duplicating and manipulating the Meshes. The rocks help anchor the structure visually.

Image

Figure 8.9 My scene after a few minutes of placing meshes

This is a great time to try out different snapping options. I encourage you to explore the Surface Snapping option to help you place Actors directly on other Actors.

Placing Lights

Like you did with the Directional Sun Light and Sky Light Actors, use the Class Browser to add lights to the scene.

Clicking the Lights tab in the Class Browser presents you with a list of the available light Classes (see Figure 8.10). Simply drag and drop the Light Class you want into the Viewport to place a Light Actor into your Level.

Image

Figure 8.10 Light Classes listed in Placement Mode

Like with Static Mesh Actors, you can rotate and move Lights using gizmos or using the Details Panel’s transform controls. You can also copy-paste and duplicate the same way.

Light Properties

Take the time to explore the Light Actor properties in the Details Panel. It offers options for brightness, shadow casting, and color. Many of these options are purely visual while many are tied closely to performance.

Dynamic Lights and Performance

Because you are using dynamic lighting, be careful how many lights you use. Although the deferred renderer of UE4 allows for many more dynamic lights than previous generation rendering techniques, they are expensive effects, especially when it comes to shadowing.

Shadows

Dynamic shadows add a lot of rendering overhead and you should use them sparingly. Shadowed point lights are the most expensive kind of light to render and should be used the most sparingly.

Attenuation Radius

You can also reduce the Attenuation Radius of your lights as much as possible to improve performance. Actors outside the radius will not be affected by the light and won’t calculate lighting and shadows from that light.

Adding IES Profiles

UE4 supports 2D IES profiles for spot and point lights. IES profiles modulate the light’s brightness using a Texture generated from an imported IES file. UE4 ships with several IES profiles, or you can import your own into the Content Browser as you would with any other content type.

Here’s my scene after placing a few lights (see Figure 8.11). I’ve also added some IES profiles to the spot lights to make them a bit more interesting. You can find the IES property in your Details Panel when you select a Light Actor in your Level.

Image

Figure 8.11 Final scene in the Editor with all four Viewports set to Perspective, allowing me to see the Level form multiple perspectives as I work

Summary

You’ve seen how easy it is to populate your Levels with Assets. Lights, Materials, and Actors can easily be dragged and dropped, copied and moved, and rotated and scaled as easily as in our favorite 3D application. Building Levels in UE4 is fun and interactive and getting a great lighting setup is very easy using the Atmospheric Fog and Skylight.

It’s fun to have complete create control over a virtual space and to create something without any real constraints other than the simple requirements of walls and a floor.

I have included this scene at www.TomShannon3d.com/UnrealForViz for you to open on your own and play with.

..................Content has been hidden....................

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