You are on page 1of 8

Object 1 Object 2

COVID-19 Support:
We’re providing all users three months of complimentary access to Unity Learn Premium, from
March 19 to June 20, 2020.
Projects
Courses
Tutorials
Learn Live
Topics

Premium

Configuring Lightmaps
Tutorial
Beginner
15 Mins
Overview
Tutorial Materials
Details
1
Your progress
Where am I?
1.
Configuring Lightmaps
2.
Getting to Know Lightmap Settings
3.
Enlighten Settings
4.
Progressive Settings
5.
Setting up for Baking
6.
Baking the Lightmap
Summary
Lightmapping is the process of pre-calculating the brightness of surfaces in the Scene. It stores the
information it calculates in a chart or lightmap for later use. Lightmaps allow you to add global
illumination, shadows, and ambient lighting at a relatively low computational cost. In this tutorial,
we’ll get to know the lightmapping settings.
Recommended Unity versions
2018.1
Topics we'll cover
Project Management
Lighting & Visual Fidelity
Industry
AEC
Automotive
Film
Games
Language
English

Tutorial
Configuring Lightmaps
1

1.Configuring Lightmaps
Lightmapping is the process of pre-calculating the brightness of surfaces in the Scene. It stores the
information it calculates in a chart or lightmap for later use. Lightmaps allow you to add global
illumination, shadows, and ambient lighting at a relatively low computational cost.
The Unity Engine uses the Progressive Lightmapper system, which bakes lightmaps for your scene
based on how your scene is set up. It takes into account all the meshes, materials, textures, and
lights within the scene as it does its pass. When a lightmap is generated, GameObjects
automatically use them as they are an integral part of the Unity rendering engine.

2.Getting to Know Lightmap Settings


Let’s get your Scene and lightmap set up:
From the Windows dropdown select Lighting > Settings from the toolbar. This will open the
Lighting Window. (Figure 01)
Figure 01: Lightmapping Settings in the Light Settings Window
• Collapse all the windows and leave only Lightmapper Settings expanded.
• Change the Lightmapper setting to Enlighten.

3.Enlighten Settings
For now, we’re only concerned about the Lightmap Settings in the Light Setting Window.
• Lightmapper: Use this to specify which internal lighting calculation to use when
calculating the lightmaps in a scene. The options are Progressive and Enlighten.
• Indirect Resolution: This option is only available when Realtime Global Illumination is
enabled. Use this to specify the number of texels per unit to use for the indirect lighting
calculation. The higher the number, the higher the quality, but this also increases the bake
time. This setting refers to both Height and Width of the Lightmap.
• Lightmap Resolution: Use this to specify the number of texels per unit to use for
lightmaps. The higher the number, the higher the quality, but this also increases the bake
time. This setting refers to both Height and Width of the lightmap.
• Lightmap Padding: Use this to specify the separation between the different shapes in the
baked lightmap.
• Lightmap Size: The size of the full lightmap texture.
• Compress Lightmaps: Toggle this to compress your lightmap. Compressed lightmaps use
less disk space, but the compression process can introduce unwanted visual artifacting into
the texture.
• Ambient Occlusion: Toggle this to adjust the additional settings of the ambient occlusion in
your lightmap (Figure 02). The additional settings are: Max Distance, which controls how
far the lighting system will cast rays. Indirect Contribution controls the brightness of the
indirect light as seen in the final lightmap. Finally, Direct Contribution controls the
brightness of the direct light.

Figure 02: Ambient Occlusion Settings


• Final Gather: Toggle this if you want Unity to calculate the final light bounce in the GI
calculation at the same resolution as the bake lightmap. This option will improve the visual
quality of the lightmap but it also increases the bake time.
• Directional Mode: This option allows you to store information about the dominant light at
each point on a GameObject. It has two settings: Directional Unity will generate a second
lightmap to store the dominant direction of incoming light. This allows for diffuse normal-
mapped materials to work with the GI. Non-Directional Unity does not generate a second
lightmap, but stores it within the same lightmap that is generated.
• Indirect Intensity: This controls the brightness of the indirect light that Unity stores in its
Realtime and Baked lightmaps.
• Albedo Boost: This controls the amount of light Unity bounces between surfaces by
intensifying the Albedo Materials.
• Lightmap Parameters: This allows you to select a few predefined settings for the
Lightmap. The options you can select to set the default settings of the lightmap from Very
Low, Low, Medium, and High defaults. This setting will also allow you to save your own
custom settings into a new default option.

4.Progressive Settings
Now that we’ve covered the settings for the Enlighten mode, let’s take a look at the Progressive
mode.
• In the Light Settings window, change the Lightmapper option to Progressive. (Figure 03)
Figure 03: Progressive Lightmap Settings
Progressive mode settings differ a bit from Enlighten mode. We’ll cover those differences here.
• Prioritize View: Enable this to cause the Lightmapper to apply changes to the texels that are
currently visible in the Scene View before applying changes to the out-of-view texels.
• Direct Samples: This controls the number of samples shot from each texel. It ultimately
controls the number of samples that Progressive Lightmapper uses for direct lighting
calculations.
• Indirect Samples: This controls the number of samples shot from each texel. It ultimately
controls the number of the samples that Progressive Lightmapper uses for indirect lighting
calculations.
• Bounces: This controls the number of indirect bounces to do when tracing paths. Usually for
most scenes a value of 2 is enough.

5.Setting up for Baking


No matter if you choose Progressive or Enlightened Lightmapper settings, you will understand how
to properly set up your project for lightmap baking.
• First, make sure any Mesh you want to apply a lightmap to has proper UVs for
lightmapping. The easiest way to do this is to open the Mesh Import Settings and enable the
Generate Lightmap UVs setting.
• Within the Light Settings window, under the Lightmapping Settings, select the Lightmapper
setting you wish to use: Progressive or Enlightened.
• Next, you want to set the resolution of the lightmaps. Adjust the Lightmap Resolution value
to your preferred resolution.
• Now you want to ensure the GameObjects/Terrain you wish to lightmap are able to receive
the lightmap. Select the GameObjects you wish to include and make sure Lightmap Static is
checked in the Mesh Renderer Component (Figure 04). This tells Unity that the
GameObjects with this turned on don’t move or change. Unity will then add to them to the
lightmap.

Figure 04: Lightmap Static toggle in the Mesh Renderer


• Finally, you might want to adjust the settings of your Lights in the Light Explorer. To access
this, go to the Windows dropdown and select Lights > Light Explorer. (Figure 05)

Figure 05: Light Explorer Window


• Here, you can adjust which lights will be visible, their colors, intensities and so forth. This is
for any fine-tuning you might need to make before baking the lightmap.

6.Baking the Lightmap


Now, with the set up done and the quick overview of the myriad settings, it’s time to bake our
lightmap.
• If the Light Settings window is not open, reopen it by opening the Windows dropdown and
selecting Light > Settings.
• Ensure that you are within the Object Maps tab within the Lighting Window.
• At the bottom of the Scene tab of the window, click Generate Lighting or toggle the Auto
Generate tick box next to it. (Figure 06)
Figure 06: Generate Lighting button in the Light Settings window
• Once that’s done, a Progress bar will appear in the Unity Editor status bar in the bottom-
right corner. (Figure 07)
Figure 07: Lightmap Progress Bar
• When the baking is complete, you will be able to see all the baked lightmaps in the Global
Maps and Object Maps tabs of the Lighting Window.
Figure 08: Object Maps after Lightmap has been generated
Once the Lightmaps have been generated, Unity will update the Scene view automatically so you
can see the results and make any necessary adjustments.
Lightmaps provide a great benefit from scenes with many static light sources as it precomputes all
the lighting and shading information and removes the cost from the runtime of the project. It can
have potentially large savings with large complicated scenes with plenty of light sources.

Configuring Lightmaps
General Tutorial Discussion
0
1
1. Configuring Lightmaps
0
0
2. Getting to Know Lightmap Settings
0
0
3. Enlighten Settings
0
0
4. Progressive Settings
0
0
5. Setting up for Baking
0
0
6. Baking the Lightmap
0
0
Copyright © 2020 Unity Technologies
Legal
Privacy Policy
Cookies
Language:

English
简体中文
한국어
日本語
Русский
Español
Français
Deutsch
Português

You might also like