Unreal Engine Part 13: Lighting

In chapter 13 of Rob Redman's comprehensive video introduction to Unreal Engine, learn how to correctly light your scene...

Previous tutorials

Part 1: Setting up a new project
Part 2: Introducing materials and landscapes
Part 3: Adding foliage and rocks
Part 4: Particle smoke
Part 5: Introducing the skybox
Part 6: Setting up cameras and post-effects
Part 7: Teleporters
Part 8: Adding random assets
Part 9: Destruction
Part 10: Adding sound
Part 11: Linking audio to actions and objects
Part 12: Using the matinee tool

When it comes to film, games and TV, there are two components that really need to be right for things to work properly. It doesn't matter how good a script, model, texture or actor might be, if you can't see them and hear them appropriately then the end result has failed. Of course I say appropriately rather than well, as sometimes you can use a lack of sound or light to enhance the mood, so keep your context in mind.

In this chapter I'm going to walk you through some simple but very effective lighting. Using a simple scene we will try to convey a mood using nothing but the light. When you add your new lighting skills to the sound from earlier chapters, you should be able to direct your player to feel exactly as you wish.


Click here for downloadable assets to accompany this tutorial

Initial scene

For this example I've used about as basic a scene as I could, to emphasise how a single light can change the mood of your level entirely. There is a simple ground plain and a model of a chair. There is also a directional light, there just so you can see the level. In fact, the first step is to go to the outliner and delete that directional light. You should have a black viewport.

If you're reusing a level make sure there are no lights, including things like atmospheres and fog.

If you're reusing a level make sure there are no lights, including things like atmospheres and fog.

Making a point

The simplest light is a point light, so head over to the lights section of the Classes panel and drag a Point Light into the scene and place it above the chair. In the details section you can change a few settings to dial in the look you need. Colour is obvious, but if you want more control, balance the Strength and Attenuation. Strength does what you expect and the attenuation controls the outer sphere cage you can see. This marks the outer bounds of the lights reach, so anything outside this will not be lit. There are more controls but for now get used to these and then experiment more by delving in to the others.

A pool of light is more interesting and gives a hint of atmosphere or 'feel' to the scene.

A pool of light is more interesting and gives a hint of atmosphere or 'feel' to the scene.

In the spotlight

One problem with the point light that you may not have thought of yet is that it sends its light in every direction, as it's spherical in nature. For this example that's fine, but if you wanted to keep the chair in the pool of light but have other objects that were only just visible, or not at all, you will need a different solution. That is, of course, the spotlight.

I reduced the point light's strength to zero then added a spotlight in roughly the same position. Now you can use the rotate tool to direct this new light exactly where you want it, from whatever angle suits.

Attenuation is the same as for a point light but will act as though it's a segment of a sphere, rather than the whole thing. Likewise you can adjust the size of the bulb by changing the source radius and length controls.

A spotlight can look similar but is by its nature, more controllable.

A spotlight can look similar but is by its nature, more controllable.

Get physical

So far we have only looked at procedurally controlled lights. Admittedly we have been taking a high level look at lights but it's actually very easy to start using photorealistic lights with real world values and dispersion patterns.

Head to the details tab of the spotlight and scroll down until you see a material slot for an IES file. That is an illumination data file for many light fittings you can buy. I've included one here for you but do look for more as they vary hugely.

You can check the box to take the light's strength from the IES file but you don't have to.

No worrying about intensities or falloff when using ies files.

Adding a balance light

I'm sure you know about 3-point lighting and that absolutely has its place in games too, but, due to the nature of a player's movement, sometimes it can fall down from certain angles, so I find a different method can work better although it has its basis in the 3-point idea.

I increased my point light's intensity and cooled off the colour by adding some blue. Moving this light to the opposite side of the area adds some tonal variation, balanced against the warmth of the spot. You can then add a very low strength directional light to add a little overall visibility and tone, as black can appear too stark.

This variation of the three-point setup works well for interactive scenes, where you can't be sure of the viewer's point of view.

This variation of the three-point setup works well for interactive scenes, where you can't be sure of the viewer's point of view.

In the next chapter we will look at post processing effects to add some pop and sparkle to your levels.

Top tip: Light bulb manufacturers

Most manufacturers of light bulbs actually provide IES profiles on their websites, so if you have seen a light in the real world that you would like to replicate it's probably not too difficult.

Related links

Part 1: Setting up a new project
Part 2: Introducing materials and landscapes
Part 3: Adding foliage and rocks
Part 4: Particle smoke
Part 5: Introducing the skybox
Part 6: Setting up cameras and post-effects
Part 7: Teleporters
Part 8: Adding random assets
Part 9: Destruction
Part 10: Adding sound
Part 11: Linking audio to actions and objects
Part 12: Using the matinee tool

Download Unreal
Buy a copy Unreal Game Engine