[Unity] Tips and tricks for setting up beautiful indoor lighting!

Introduction

Lighting is a very important element in game development and design.

In particular, indoor scenes have many elements that greatly influence the atmosphere and expressiveness of the scene, such as light coming in through windows and indoor light sources. If lighting is set up properly, it can enhance the realism and immersion of the scene.

Additionally, lighting plays a major role in the visual representation of objects and characters, influencing the appearance of surface textures and reflections, which directly impacts the overall quality of the game.

In this article, we will introduce methods and tips for achieving beautiful indoor lighting through hands-on examples!

Preliminary preparations

This time, we will model the lighting in the room based on this room asset.

Since the lighting was already set up in the demo scene, I copied only the demo scene models and pasted them into the newly created scene.

Let’s start writing from here!

Writing Settings

Writing is performed according to the following steps. Each step will be explained in detail.

Indoor lighting procedure

  1. Light placement
  2. Reflection Probe placement
  3. Light baking
  4. Post-processing finishing

Light placement

Change the Transform > Rotation of the Directional Light to adjust the direction of the light coming in through the window. This will brighten up the room.

Incorporating light reflections using Reflection Probes

What are Reflection Probes?

Reflection Probes are a mechanism used in games to realistically display the scenery reflected on the surface of objects.

Let’s explain with an example.

1. Something like a mirror

Think of a mirror. A mirror reflects and displays the surrounding scenery and objects, right? A Reflection Probe works similarly in a game, reflecting the surrounding scenery onto the surface of objects.

2. A camera that captures the surrounding scenery

A Reflection Probe is like a small camera placed at a specific location within the game. This camera captures the entire 360-degree view of the surrounding scenery.

3. Projecting onto objects

Using the captured scenery information, the scenery is projected onto objects in the game. For example, the sky and surrounding buildings can be reflected in a puddle, or the surrounding scenery can be reflected on a shiny car.

Simple examples

School pool: The sky and school buildings are reflected on the surface of the pool, right? Using a reflection probe, the surrounding scenery can be realistically reflected on the water surface in the game as well.

Glass building: Large glass buildings reflect the surrounding scenery. By using a reflection probe, the surrounding scenery can be reflected on the glass of the building in the game.

A reflection probe is a mechanism that reflects the surrounding scenery on the surface of objects in the game to make them look more realistic. With this, the game world looks more like the real thing and is more enjoyable.

How to place Reflection Probes

Create a Reflection Probe from the Hierarchy.

Place the Reflection Probe in the center of the room and adjust the Box Size in the Inspector so that the room fits inside.

Furthermore, checking the Box Projection box will improve the quality of reflections in the room.

With this, the overall bluish tint has been improved and the shadows are now clearly visible.

Bake lights to create realistic lighting

What is light baking?

Lighting calculations are heavy processing, so we want to avoid performing them during gameplay as much as possible. Therefore, we need to perform the calculations in advance. This is called baking.

Simply put, “light baking” is the process of creating brightness in advance within the game.

By using this, the game will look more realistic and run more smoothly.

How do you use it?

Calculate the light

In the game, calculate where the light hits and where shadows form. For example, imagine the sun’s light hitting a building, causing its shadow to form on the ground.

Save the calculation results

The calculated light and shadow information is saved into a texture, which is like an image. This is what “baking” means.

Use it in the game

The saved light and shadow information is used in the game. This allows the game to display beautiful light and shadows without having to calculate them in real-time while the game is running.

Preparing for light baking

There are a few preparations to make before baking, so we will explain the steps.

Set non-moving objects to Static

Objects with the Static checkbox selected will be included in the baking process. Conversely, if the checkbox is not selected, lighting will be calculated in real time during the game, so be sure to select the Static checkbox for any objects that do not move.

Light settings

Set the lights in the scene to Mixed or Baked.

Reflection Probe Settings

Set Reflection Probe to Baked.

Start baking lights

Now, let’s start baking.

Open the lighting settings from Window > Rendering > Lighting.

Click New Lighting Settings to create new lighting settings.

Press Generate Lighting under the Lighting window to start baking.

If baking takes a long time, try lowering the quality of the Lightmapping Setting.

Once baking is complete, the reflection of light in the room is reflected, making it look realistic.

However, the interior is too dark, so let’s brighten it up.

Add an area light to the window

Create a new Area Light from the hierarchy and place it on the window.

When I baked it again, it became brighter. I placed the area light on the window so that it looks like light is coming from the window, giving it a natural feel.

Finishing with post-processing

What is post-processing?

Post-processing refers to visual effects applied after rendering games and videos. It is like a filter applied to the entire screen after the scene has been drawn. Simply put, it is the final finishing touch to make games and videos look more beautiful.

What kinds of effects are there?

There are various effects in post-processing. Here are a few examples.

  1. Blur
    • Blurring part or all of the screen creates a soft atmosphere or a sense of speed.
  2. Color Grading
    • Adjust the color of the entire screen to make it brighter or darker, or to emphasize specific colors.
  3. Bloom
    • Brighten bright areas to make the light feel stronger. This is used to make sunlight and light from lamps look more realistic.
  4. Depth of Field
    • Like a camera lens, this effect focuses on nearby objects and blurs distant objects to create a sense of depth.
  5. Film Grain
    • This effect adds a slightly grainy texture to the screen, similar to old movies, to create a specific atmosphere.

When you apply Color Grading and Bloom in post-processing, the result looks like this. The overall appearance has improved significantly.

Please see here for installation and usage instructions for post-processing.

Color grading was adjusted by tweaking the mode, temperature, gamma, and gain. Feel free to experiment with these settings to find the look you prefer.

Furthermore, adding Ambient Occlusion will make the shadows clearer, so we recommend it. The corners of the room have become darker.

Conclusion

That concludes our introduction to indoor lighting!

Basically, follow the steps below to set up your lighting, and repeat the bake process while making minor adjustments as necessary. It is most efficient to perform post-processing as a final step after the bake is complete.

Indoor lighting procedure

  1. Light placement
  2. Reflection Probe placement
  3. Light baking
  4. Post-processing finishing

Recommended realistic indoor assets are here.
Japanese Apartment