Feature Highlight: Creating Beautiful Lighting in Unity

Chase Mitchell
5 min readMay 5, 2021

--

Lighting can really make you game shine (pun intended), so in this guide I’ll cover a few ways you can create beautiful lighting in your Unity games! I’ll cover a few ways to do this including the emission channel, light mapping, light probe groups, reflection probes and screen space reflections.

Emission Channel (self illuminance)

The emission channel is a way to produce a lighting effect without a light source by grabbing the light data of a color or texture. Let’s take this display case for example — this object is entirely self-illuminated using the emission channel.

We can see this clearly if we remove the black color texture — our case appears to be glowing all on its own. Similar to our display cases from the last guide, this lighting direction is built into the model of the case using the texture map.

The lighter color rims inside the texture map indicate which areas should be giving off illumination. The benefit of using this type of illumination is that it allows you to cut down on light sources in your scene and if you have many objects this can be a major boon to performance.

Light Mapping

To view your Lightmapping settings navigate to Window -> Rendering -> Lighting. There are a few ways you can handle baking lighting in Unity. The term baking here essentially refers to the computational process by which the engine determines how to properly light your scene. To handle this process, there is the progressive preview mapper, which will re-bake the scene in real-time whenever you make a change, allowing you to see the results quickly. There is also the enlighten mode where your scene has to fully bake before you can see the changes. In the lightmapping settings you can use the Auto Generate tool to automatically bake your lighting when something is updated, but if that setting is off you are responsible for using “Generate Lighting” yourself to re-bake the lighting data as needed.

In the images above, we have an emission-illuminated cube that is giving off light which we can see on the ground and reflected in the sphere. When the cube is moved, until the lighting has been re-baked you can see that the lighting data has not changed and the floor and sphere are still illuminated as if the cube is right next to them. Only after the lighting has re-baked can we see how this change will truly look in our game.

Now that the light baking has finished, we can see that the illumination has moved to correctly match our new lighting placement. So this is how light baking works, and hopefully illustrates why it is important to bake your lighting after making a change like this so you can see the true final product. For ease of use simply keep auto generate enabled.

Light Probe Groups

Light probes are a coordinated group of lights that pick up baked lighting information and relay it to dynamic objects. They are a way to create a lighting infrastructure for your game that all game elements will adhere to.

This yellow-point matrix is what a light probe group looks like. You want to put a light probe around any objects that you want to share light data i your scene.

By stretching the light probe group out around both our objects giving off emission data (the cube and security desk monitors here) and our dynamic object passing through (the sphere), we have created dynamic lighting by intaking the static light data from the emitting objects and passing it on to our dynamic object. We are using the light probes to share lighting and spread it around our scene.

By creating comprehensive networks of light probes, you can create widely illuminated areas from a single light source. Using many individual lights is computationally expensive, so this setup is much better for performance — especially on mobile!

Reflection Probes vs Screen Space Reflections

A reflection probe is a lighting tool used to sample a local environment and create reflections of the surrounding objects. To create one, go to your hierarchy create menu -> Light -> Reflection Probe.

The reflection probe has a gold cube bounds attached to it, which is the area over which you would like to apply reflections. We can drag it to fill our space, in this case the floor. To do this click to “edit bounding volume” and reshape to fit.

Now we can see a subtle reflection on our sample doors, indicated by the slight color difference between the top and bottom of the door (which is the line at which our reflection bounds end).

Reflection probes are considered cheap reflections because they are not performance intensive but they also do not provide as dramatic an effect.

Screen Space Reflections on the other hand can be used to create really beautiful and dramatic reflections in your game at the cost of higher performance demand. These are a little more involved and are handled through the post processing stack, but look at these results!

Screen Space Reflections are definitely worth it if your game performance can handle it.

That’s it for lighting! In the next guide I’ll cover how to create the awesome New York skybox we have in the background here. See ya there!

--

--