A Lighting Settings Asset represents a saved instance of the LightingSettings class, which stores data for the Baked Global IlluminationA group of techniques that model both direct and indirect lighting to provide realistic lighting results. Unity has two global illumination systems that combine direct and indirect lighting.: Baked Global Illumination, and Realtime Global Illumination (deprecated).
See in Glossary and the Realtime Global Illumination systems. The Unity Editor uses this data when it precomputes lighting data for a SceneA Scene contains the environments and menus of your game. Think of each unique Scene file as a unique level. In each Scene, you place your environments, obstacles, and decorations, essentially designing and building your game in pieces. More info
See in Glossary that uses one or both of these systems.
You can assign the same Lighting Settings Asset or instance of the LightingSettings
class to more than one Scene, which makes it easy to share Global Illumination system settings across multiple Scenes.
There are two ways to create a Lighting Settings Asset in the Unity Editor.
To create a Lighting Settings Asset from the Project view:
To create and automatically assign Lighting Settings Asset from the Lighting window:
You can also create a Lighting Settings Asset from a script. To do this, create an instance of the LightingSettings class and either save it to disk, or assign it to a Scene and save that Scene. For more information and code examples, see the LightingSettings API documentation.
To assign a Lighting Settings Asset to a Scene in the Unity Editor:
You can also assign a Lighting Settings Asset to the active Scene from a script. To do this, load the Lighting Settings Asset to obtain an instance of the LightingSettings
class, then use the Lightmapping.lightingSettings
API to assign that LightingSettings
instance to the active Scene. For more information and code examples, see the LightingSettings API documentation.
You can view and edit the properties of Lighting Settings Asset in two places in the Unity Editor:
You can also read from or write to the properties of a Lighting Settings Asset from a script. To do this, load the Lighting Settings Asset to obtain an instance of theLightingSettings
class, and access its properties. For more information and code examples, see the LightingSettings API documentation.
When a Scene does not have a Lighting Settings Asset assigned to it, Unity uses the default LightingSettings
object for that Scene. The default LightingSettings
object is an internal, read-only instance of the LightingSettings
class.
You cannot make any changes to the LightingSettings
data for a Scene that uses the default LightingSettings
, but Unity can perform a bake using its settings.
To make changes to the LightingSettings
data for a Scene, you must use the Unity Editor to create and assign a Lighting Settings Asset, or use a script to create, configure, and assign a LightingSettings
object. For more information and code examples, see the LightingSettings API documentation.
When you view the Lighting Settings Asset in the Inspector or the Lighting window, the properties that you can view or edit are divided into the following sections:
This section contains settings related to the Realtime Global Illumination system. This section is visible only when using the Built-in Render Pipeline; Realtime Global Illumination is supported only in the Built-in Render Pipeline, and is not supported in URP or HDRP.
Note that the Realtime Global Illumination system is deprecated, and will soon be removed. For more information, see the Unity blog.
Property: | Function: |
---|---|
Realtime Global Illumination (deprecated) | If this checkbox is ticked, Unity enables the Realtime Global Illumination system in Scenes that use this Lighting Settings Asset. |
Realtime Environment Lighting | Enable this property to use the Realtime Global Illumination system to calculate and update ambient light in real-time. Disable this property to use the Baked Global Illumination system to precompute the ambient light in the Editor, and then apply it at runtime. This property is only available when both Realtime Global Illumination and Baked Global Illumination are enabled in the Scene. |
This section contains settings that affect the behavior of Baked LightsLight components whose Mode property is set to Baked. Unity pre-calculates the illumination from Baked Lights before runtime, and does not include them in any runtime lighting calculations. More info
See in Glossary
and Mixed LightsLight components whose Mode property is set to Mixed. Some calculations for Mixed Lights are performed in advance, and some calculations for Mixed Lights are performed at runtime. The behavior of all Mixed Lights in a Scene is determined by the Scene’s Lighting Mode. More info
See in Glossary
in Scenes that use this Lighting Settings Asset.
Property: | Function: | |
---|---|---|
Baked Global Illumination | When this setting is enabled, Unity enables the Baked Global Illumination system for the Scenes that use this Lighting Settings Asset. When this setting is disabled, Unity disables the Baked Global Illumination system for the Scenes that use this Lighting Settings Asset. When the Baked Global Illumination system is enabled, Unity uses Baked lights in the Scene for lightmapping only, and Mixed lights behave according to the Lighting Mode setting. When the Baked Global Illumination system is disabled, Unity forces all Baked and Mixed lights in the Scene to act as though they were Realtime Lights. |
|
Lighting Mode | Specifies which Lighting Mode Unity uses for all Mixed Lights in the Scenes that use this Lighting Settings Asset. When you change the Lighting Mode, you need to re-bake the lighting data for the Scenes that use this Lighting Settings Asset. |
|
Baked Indirect | Use Baked Indirect Lighting Mode for all Mixed Lights in the Scenes that use this Lighting Settings Asset. | |
Subtractive | Use Subtractive Lighting Mode for all Mixed Lights in the Scenes that use this Lighting Settings Asset. Note that Subtractive Lighting Mode is not supported in the High Definition Render Pipeline (HDRP). |
|
Shadowmask | Use Shadowmask Lighting Mode for all Mixed Lights in the Scenes that use this Lighting Settings Asset. Note that Shadowmask Lighting Mode is not supported in the Universal Render Pipeline (URP). |
This section contains settings related to lightmapping.
Lightmapping settings are specific to each lightmapperA tool in Unity that bakes lightmaps according to the arrangement of lights and geometry in your scene. More info
See in Glossary
backend. To see the settings for a lightmapper, see:
When you view a Lighting Settings Asset in the Inspector, this property is at the top of the Inspector. When you view a Lighting Settings Asset in the Lighting window, this property is at the bottom of the Lighting window, near the Generate Lighting button.
Property: | Function: |
---|---|
Auto Generate | If Auto Generate is enabled, Unity precomputes lighting data automatically when you make changes to the Scene. This data includes lightmaps for the Baked Global Illumination system, lightmaps for the Realtime Global Illumination system, Light Probes, and Reflection Probes. Unity usually begins the bake a few seconds after you make a change to the Scene. If Auto Generate is disabled, you must manually invoke a bake yourself, using the Generate Lighting button in the Lighting window, or the Lightmapping.Bake or Lightmapping.BakeAsync APIs. Note that when you precompute lighting data using Auto Generate, the precomputed lighting data is not stored as Assets in your Project. It is instead stored in memory, and serialized as part of the Scene. |
When you visit any website, it may store or retrieve information on your browser, mostly in the form of cookies. This information might be about you, your preferences or your device and is mostly used to make the site work as you expect it to. The information does not usually directly identify you, but it can give you a more personalized web experience. Because we respect your right to privacy, you can choose not to allow some types of cookies. Click on the different category headings to find out more and change our default settings. However, blocking some types of cookies may impact your experience of the site and the services we are able to offer.
More information
These cookies enable the website to provide enhanced functionality and personalisation. They may be set by us or by third party providers whose services we have added to our pages. If you do not allow these cookies then some or all of these services may not function properly.
These cookies allow us to count visits and traffic sources so we can measure and improve the performance of our site. They help us to know which pages are the most and least popular and see how visitors move around the site. All information these cookies collect is aggregated and therefore anonymous. If you do not allow these cookies we will not know when you have visited our site, and will not be able to monitor its performance.
These cookies may be set through our site by our advertising partners. They may be used by those companies to build a profile of your interests and show you relevant adverts on other sites. They do not store directly personal information, but are based on uniquely identifying your browser and internet device. If you do not allow these cookies, you will experience less targeted advertising. Some 3rd party video providers do not allow video views without targeting cookies. If you are experiencing difficulty viewing a video, you will need to set your cookie preferences for targeting to yes if you wish to view videos from these providers. Unity does not control this.
These cookies are necessary for the website to function and cannot be switched off in our systems. They are usually only set in response to actions made by you which amount to a request for services, such as setting your privacy preferences, logging in or filling in forms. You can set your browser to block or alert you about these cookies, but some parts of the site will not then work. These cookies do not store any personally identifiable information.