How To Set Up Lighting for Games in Unreal Engine: Part 2

This is the second part of Yuri Vorobiev's massive guide on setting up lighting for games in Unreal Engine. You can read Part 1 here.

Second Lighting Pass

At this stage, it is time to consider the kinds of light fixtures available and how they can believably emit light. This should give you clarity about the kinds of lights you can use, their location, and direction.

For example, it would be odd if ceiling lights 1 were located everywhere on the ceiling, but at one specific place, they were attached to the wall and emitted light in just one direction. In another case: lamp 2, which is expected at the ceiling or on a wall, will end up in the center of the room. In simple words: lighting should look realistic and plausible.

For this room, I placed two large ceiling lamps in the monitor area and three lamps to light the machinery.

Make sure your light fixtures are not floating in the air.

Consider spaces where lamp light is usually located – in the center of the shape; make sure your lighting objects correspond to the pattern of the environment if any. For example, you should not place them on pipes or other geometry that is not designed for lamps.

Make sure that the color of the emissive matches the color of the light.

Keep an eye on your lighting emissive intensity to make the amount of light emitted look believable.

Please name your lights properly so you know what each light does by name only. Always keep your folder structure clean and simple. Good maintenance is the key. Trust me, it will save you soo much time in the future when you won’t spend tens of minutes recalling how your setup works when you need to make several tiny changes in different objects. Also, keep in mind that during production, other Lighting Artists may work at your level, so you do it for yourself and other teammates.

I will use this room to analyze three lighting scenarios with you. I will briefly talk about the limitations of each scenario, the best approaches to setting up light sources and cover the performance aspect.

Movable lighting

All lighting is dynamic and you don't need to bake anything. This is always the most performance-heavy option and because of that, you want your lights to be as optimized as possible. Since there will be no bake data on the walls, and it is very expensive to light them with light sources, I increased the SkyLight by 50%. For the ceiling lamps, I placed one wide Spot Light with shadows so that it illuminates the left wall a little bit as well as small Point Light for each lamp to give the ceiling some visual interest.

You may be tempted to place one Spot Light per lamp, but that would be too performance-heavy. Also, keep in mind that two intersecting dynamic shadows are too much for this place. Creativity comes from limitations, therefore frame your creativity with optimization in mind. If you can easily replace two lights with one almost the same size – go for it.

After that, I added two blue Rect Lights on the sides to simulate bounce light from the lamps.

In this part of the room, I added small green Spot Lights with shadows to each lamp. The middle one is slightly more intense for visual interest.

At this moment, I realized that lighting everything green in the area would be a bit dull. Additionally, when you stand in the blue ambient (right side of the bottom screen), it's hard to see the difference between the walls and you can't see the passage. My solution was to add an orange tripod lamp there with a little bounce light.

Be careful when placing large lamps in the gameplay area. It is best to keep them closer to walls or large existing objects.

For the dark corner, I added green ambient Spot Light with "Falloff Exponent" 2.

To improve the readability of the shapes, I added small Spot Lights to highlight the shapes.

1 of 2

In the last case, I used "Light Channels" since I want only the stairs to be lit by these lights.

Capturing reflections

When capturing reflections with movable lights, there will be no light in the reflections because UE does not capture dynamic lights. But you may want to capture them for more interesting reflections. To do this, I switch all the lights I want to capture to Static.

A lot of "Preview" text appears in the shadows, and we don't want it to be captured in the reflections. You can disable it in Show > Visualize > Preview Shadows Indicator, but it will remain captured.

To get rid of it you should open "Engine Content\EditorMaterials\PreviewShadowIndicator" and set its Brightness to 0. And then just Build Reflection Captures.

I want this place to have more ambient green light, so I added a cubemap with Brightness 1.5 here.

For this setup, my "Light Complexity" looks like this. Everything must be predominantly blue-green.

Static lighting

This scenario is the least demanding in terms of performance because all lights are pre-baked. The only disadvantage is that you won't have dynamic shadows or specular from light sources. The main source of specular will be cubemaps.

The light sources for this setup will be almost the same. The only big difference is that I split one blue light into two. And set "Indirect Light Intensity" to 0.2 because I didn’t want the ceiling to be too bright.

If I left one Spot Light above the ceiling it would have caused errors on the ceiling and strange shadows from lamps. Light channels cannot be used for static lighting, and it is best to keep the lights outside the geometry.

This orange light has lost all specularity and appears very dull. So I placed a small local cubemap to bring back some reflections.

Same for this space – added 3 Sphere Reflections.

Added subtle green Spot Lights as bounce light to fill this space more with green light.

Stationary lighting

I find stationary lighting to be the best of both worlds. You can bake what you want but also have dynamic shadows and specular from the lights. In this room, I set everything to Static except the blue lamp Spot Light and the orange light of the tripod. They are set to Stationary.

In the next hallway, I placed Static magenta Point Lights to fake ambient light.

To draw more attention to the doorways and improve visibility, I added subtle Point Lights. It also gives an additional connection between rooms.

I also added a Spot Light aimed at the floor to give the illusion of ambient light coming from the hallway. When the player goes down the stairs – they clearly understand which path to take with the help of lighting.

To make this hallway a bit more exciting, I added a faint Stationary accent light from a tripod. I moved the orange light color closer to the magenta to minimize the visual noise and changed the direction of the Spot Light so that it aims the player more toward the next room.

The metal structures were too dark, so I added a Box Reflection and increased its Intensity to make them stand out more.

Finally, I added a small Box Reflection to the door to have good reflections on the metal surface.

For the next corridor, the setup is very simple. These are just 3 Point Lights with increasing Intensity from the camera point to the next room. Such a trick gives you an additional feeling of volume.

In the room with stairs, I like how the light in the middle of the stairs draws the player’s attention. It also gives interesting shadows on the right wall and it would be cool to see them if you come from the hallway. So I decided to add a light fixture in there with blue Stationary Rect Light.

Remember to place disabled lamps where it makes sense.

For my taste, there is not enough light on one of the walls and the floor. So I added a Spot Light for better lighting.

For the large room, I started with a turquoise Stationary Spot Light from the monitors. It will be the focal point of the room. And added a small Rect Light to light keyboard desk.

After that, I placed lamps and orange Stationary Spot Lights with shadows.

I placed a warm fake light near the exit so the player understands where to go, and it also improves the readability of this corner.

I placed lamps on the walls near the aisles of the second floor. For each, a small Static Point Light to simulate the nearest light source, and a larger Static Spot Light to illuminate columns, catwalks, and objects under the catwalks. Light intensity also gradually increases away from the camera point.

At this stage, I saw that some objects under the catwalks lacked the resolution of the lightmap. So I increased the resolution for them.

For this mechanism, I used green color, as for other similar mechanisms. One Stationary Spot Light with shadows and Static Point Light. I also reduced the Specular Scale a bit to draw less attention to it.

To define the top of this structure more, I placed some fake green and blue spotlights around it.

I added local reflections on the catwalks, green mechanism, and near-blue monitors.

1 of 2

Polishing Lighting Pass

This stage is truly the icing on the cake. Here I add more atmosphere with volumetric fog, godrays, and particles. Also check various lighting bugs, readability from the player's point of view, performance, and color correction.

Volumetric fog setup

Since my exponential fog starts at 1500, I can render volumetric fog up to that distance. It's not always necessary to render it that far, and you also have to keep the performance aspect in mind. I activated Volumetric Fog inside ExponentialHeightFog and adjusted Extinction Scale and Scattering Distribution to my taste

For some lighting fixtures, it is sufficient to set the Volumetric Scattering Intensity of the respective light sources so that they have a good volume. This is applicable only if you used Stationary or Movable lights for it.

But for some of the lamps, I add their own small Movable Rect Light for volumetric fog.

1 of 2

Make sure you don't have any misplaced floating volumetric fog.

Also, be careful to match the volumetric fog to the light fixture.

Placing godrays and particles

For godrays, I'm using one from Blueprints map. I only render them at a far distance, and this is done to give additional readability and guidance to the player.

1 of 2

For more atmosphere, I placed dust particles, especially under some lights, where they are well-illuminated. Below is an exaggerated example to better understand the idea.

Also placed local fog/steam particles where it makes sense. Below is an exaggerated example.

Be sure to check how your lights work with FX. Sometimes they can be illuminated in a very unnatural way.

Bug fixing

It is no secret that it’s important to get rid of as many bugs as possible. They affect immersion and performance and can ruin a player’s experience. This is where I go through the list of the most common mistakes when working on lighting.

1. Avoid light bleeding.

2. Lack of shadows.

3. The light source clearly ends too soon.

4. Dynamic Point Lights with shadows. You can always replace it with something less expensive. Each dynamic Point Light shadowcaster gives 6 dynamic shadows.

5. Lose the material definition and the material feel.

6. The light appears abruptly.

7. Never highlight the doors that don't lead anywhere. This is very frustrating for player navigation.

8. The light starts too early before the fixture.

9. The light does not match the fixture.

10. Some light sources hit the surface in a very odd way, you can see that it is a misplaced Spot Light or Point Light.

11. Strong unmotivated light sources.

12. It's good to run through your level from the player's point of view. This way you will see where the player interacts strangely with the light. It's also better to see navigation and readability issues.

Be careful when placing fake lights in the gameplay area. The player may be unnaturally lit when crossing them. My recommendation is to keep such lights higher.

Post Process Volume setup

I activated and adjusted the Bloom, it adds realism to the behavior of the lamps. Overall the image seems a bit dark, so I set the Exposure Compensation to 1.3 to brighten it up a bit. Also activated Lens Flares and made the vignette less intense.

Checking performance

It's important to optimize the scene because if the game lags a lot, it will break your immersion and just add to the headache. Try to keep as little red and white as possible in the Light Complexity view.

It's also useful to check how fast the fog and lighting are rendered.

And I also set the Draw Distance for each dynamic light. I don't want dynamic lights to render at a distance where I can't see them.

Color grading

There are two ways to do color grading in UE: create a LUT in Photoshop or adjust it in Post Process Volume. For this scene, I'll do it in UE as I don't want to color grade it too heavy. First, I changed the temperature to be a little cooler. Then, increased the global saturation and contrast to get a more dramatic look.

I desaturated the shadows a bit and increased their contrast.

And pushed contrast for mid-tones.

Conclusion

I made a level Relight_Lighting with only lights and you can download it here. So if you have the original package you can fully check how I set up my lights. You can find the final screenshots on my ArtStation.

Special thanks to Alexander Shtonda for feedback on the content of the article and Mariya Matashchuk for proofreading the text.

Yury Vorobiev, Senior Lighting Artist

Join discussion

Comments 0

    You might also like

    We need your consent

    We use cookies on this website to make your browsing experience better. By using the site you agree to our use of cookies.Learn more