Add lighting to your game

Tutorial

·

foundational

·

+10XP

·

60 mins

·

Unity Technologies

Add lighting to your game

Lighting is a crucial element in games, as it sets the mood, enhances immersion, and influences the overall visual quality of the virtual world.

In this tutorial, you’ll add lighting to your scene to make things more polished and visually pleasing.

1. Overview

Lighting is a crucial element in games, as it sets the mood, enhances immersion, and influences the overall visual quality of the virtual world. Bad lighting has a detrimental effect on even the greatest models.

In this tutorial, you’ll add lighting to your scene to make things more polished and visually pleasing.

2. Requirements

In order to successfully complete this challenge, your project must include the following elements, styled according to the theme outlined in your design document:

  • Additional light sources
  • Baked lighting
  • An organized Hierarchy window
  • Light probes to simulate realistic and dynamic lighting effects on objects

3. Review your design document

Your Game Design Document (GDD) is still a work in progress. Take a moment to open your GDD now and review it.

Depending on the design decisions you make, your lighting setup could be completely different. A horror theme will have very few lights and a lot of contrasting dark areas, while a casual mobile game may have one or two lights that create even illumination across the whole scene.

Now, think about your specific theme and the type of lights that would make sense for your game.

4. Challenge guidance

The following sections will provide you with some guidance on each of the tasks in this challenge.

If you need a reminder on how to do this, check out the Lighting section of the Creative Core pathway again.

Add additional light sources to your scene

  • Add lighting to your scene based on your theme and design.
  • Make sure all lights that should be included in the baking process have their mode set to Baked.
  • Make sure all objects that should be included in the bake are marked as static. This should include everything that will not move at runtime.
  • If there is a need for dynamic lighting in your scene, remember to set the mode for these lights to Realtime. Remember that dynamic lights have a drastic influence on performance; use them sparingly.
  • Bake your lightmap.

Organize your Hierarchy window

Make the management of your scene easier by organizing the objects in your Hierarchy window under headings like Static, Dynamic, Lighting, UI, and Other. Feel free to add your own.

Add light probes to simulate realistic and dynamic lighting effects on objects

  • Create light probes that will cover the scene and capture baked light for the dynamic objects.
  • Bake your lighting maps again to see the effect of the light probes on the dynamic objects when the game runs.

5. More things to try

Easy: Create moving lights

Create dynamic lights in the scene by animating some of them. Remember for this to work, you will have to set the lights to realtime.

Keep in mind that realtime lighting has a high performance cost, so use them sparingly.

6. Next steps

In this tutorial, you created a custom lighting setup for your game. In the next tutorials, you will continue iterating on and improving your game.

Complete this tutorial