Version: 2020.2
阴影故障排除
Lighting Settings Asset

Lighting 窗口

The Lighting window (menu: Window > Rendering > Lighting) is the main control point for Unity’s lighting features. You can use the Lighting window to adjust settings related to the lighting in your Scene, and to optimise your precomputed lighting data for quality, bake time, and storage space.

Related APIs

You can perform many of the functions available in the Lighting window in scripts, using the LightingSettings and Lightmapping APIs.

Lighting window layout

The Lighting window contains the following elements:

The Scene tab

The Scene tab displays information about the Lighting Settings Asset that is assigned to the active Scene. If no Lighting Settings Asset is assigned to the active Scene, it displays information about the default LightingSettings object.

The Scene tab is divided into two sections:

Lighting Settings Asset controls

Use the controls in this section to assign a Lighting Settings Asset to the active Scene, or to create a new Lighting Settings Asset.

属性: 功能:
Lighting Settings The Lighting Settings Asset assigned to the active Scene.
New Lighting Settings Click this button to generate a new Lighting Settings Asset in your Project, and automatically assign the new Lighting Settings Asset to the active Scene.

Lighting Settings

Use this section to view and edit the properties of the Lighting Settings Asset or LightingSettings object assigned to the current Scene. See Lighting Settings Asset.

Workflow settings

This section contains settings that help you debug your Scene.

属性: 功能:
GPU Baking Device Use this to change the GPU that Unity uses for precomputing lighting data. This property is visible only when you use the GPU Progressive Lightmapper backend.
Light Probe Visualization 用于过滤哪些光照探针显示在 Scene 视图中。默认值为 Only Probes Used By Selection
Only Probes Used By Selection 只有影响当前选择的光照探针才会显示在 Scene 视图中。
All Probes No Cells 所有光照探针都将显示在 Scene 视图中。
All Probes With Cells 所有光照探针都将显示在 Scene 视图中,还会显示用于光照探针数据插值的四面体。
任何光照探针都不显示在 Scene 视图中。
Display Weights 启用此复选框时,Unity 将从用于有效选择的光照探针到用于插值的四面体上的位置绘制一条线。这是一种调试探针插值和放置问题的方法。
Display Occlusion 启用此复选框时,如果 Lighting Mode 设置为 __Shadowmask__,则 Unity 将显示光照探针的遮挡数据。

The Environment tab

The Environment tab contains settings related to environmental lighting effects for the current Scene. The contents depend on the render pipeline that your Project uses.

Built-in Render Pipeline and Universal Render Pipeline

In the Built-in Render Pipeline and URP, the Environment tab is divided into two sections:

Environment

The Environment section contains lighting-related settings and controls that apply to the environmental lighting in the current scene, such as the Skybox, diffuse lighting and reflections.

属性: 功能:
Skybox Material 天空盒是一种材质,它出现在场景中的所有其他对象后方,用于模拟天空或其他遥远的背景。使用此属性可选择要用于场景的天空盒。默认值是内置的默认天空盒 (Default Skybox)。
Sun Source When the Skybox Material is a Procedural Skybox, use this setting to specify a GameObject with a directional Light component to indicate the direction of the sun (or whatever large, distant light source is illuminating your Scene). If this is set to None, the brightest directional light in the Scene is assumed to represent the sun. Lights with Render Mode property set to Not Important do not affect the Skybox. The default value is None.
Realtime Shadow Color Define the color that Unity uses to render real-time shadows in Subtractive Lighting Mode.

This setting is visible only when the Lighting Mode is set to Subtractive.
Environment Lighting 此部分包含可影响当前场景中的环境光的设置。
Source 使用此属性可定义场景中环境光的光源颜色。默认值为 Skybox
Skybox 使用 Skybox Material 中设置的天空盒颜色来确定来自不同角度的环境光。这可以实现比 Gradient 更精细的效果。
Gradient 可为来自天空、地平线和地面的环境光选择单独的颜色,并在它们之间平滑混合。
Color 对所有环境光使用单调颜色。
Intensity Multiplier 使用此属性可设置场景中环境光的亮度,定义为 0 到 8 之间的值。默认值为 1。
Environment Reflections 此部分包含反射探针烘焙的全局设置,以及影响全局反射的设置。
Source 使用此设置指定是要将天空盒用于反射效果,还是使用您选择的立方体贴图。默认值为 Skybox
Skybox 选择此选项可使用天空盒作为反射源。
Custom 选择此选项可对反射使用立方体贴图。
Resolution 使用此属性可设置用于反射的天空盒的分辨率。仅当 Source 设置为 Skybox 时,此属性才可见。
Cubemap 使用此属性可指定用于反射的立方体贴图。仅当 Source 设置为 Cubemap 时,此属性才可见。
Compression 使用此属性可定义是否压缩反射纹理。默认设置是 Auto
Auto 如果压缩格式合适,则压缩反射纹理。
Uncompressed 反射纹理以非压缩状态存储在内存中。
Compressed 压缩纹理。
Intensity Multiplier 反射源在反射对象中可见的程度。
Bounces 当来自一个对象的反射随后被另一个对象反射时,便发生反射反弹。使用此属性可设置反射探针评估对象之间来回反弹的次数。如果设置为 1,则 Unity 只会考虑初始反射(来自 Reflection Source 属性中指定的天空盒和立方体贴图)。

Other Settings

Other Settings 部分包含雾、光环光晕剪影的设置。

属性: 功能:
Fog Enables or disables fog in the Scene. Note that fog is not available with the Deferred rendering path.
Color 使用拾色器设置 Unity 用于在场景中绘制雾的颜色。
Mode 定义雾化效果随着与摄像机距离变化而积累的方式。
Linear 雾效强度随着距离线性增加。
Start 设置在距离摄像机多远时开始雾效。
End 设置在距离摄像机多远时雾效完全遮挡场景游戏对象。
Exponential 雾效强度随着距离呈指数增加。
Density 用于控制雾效的强度。雾效随着 Density 增加而显示为更强。
Exponential Squared 雾效强度随着距离更快速增加(指数和平方)。
Density 用于控制雾效的强度。雾效随着 Density 增加而显示为更强。
Halo Texture 设置要用于在光源周围绘制光环的纹理。
Halo Strength 定义光源周围光环的可见性,值在 0 到 1 之间。
Flare Fade Speed 定义最初出现镜头光晕之后从视图中淡出的时间(以秒为单位)。默认情况下,该值设置为 3。
Flare Strength 定义光源下镜头光晕的可见性,值在 0 到 1 之间。
Spot Cookie Set the Cookie texture you want to use for spot lights.

High Definition Render Pipeline

In HDRP, the Environment tab allows you to specify which sky to use for environment lighting. For more information on environment lighting in HDRP, see Environment Lighting in the HDRP documentation.

属性: 功能:
Profile A Volume Profile for the sky. This Volume Profile must include at least one Sky Volume override.
Static Lighting Sky The sky to use for the Global Illumination simulation. The drop-down only contains sky types that the Profile includes. For example, if the Profile includes a Gradient Sky Volume override, you can select Gradient Sky from this drop-down.

You can only edit this setting if you assign a Volume Profile to the Profile field.

The Realtime Lightmaps tab

The Realtime Lightmaps tab shows a list of all lightmaps generated by the Realtime Global Illumination system in the current Scene. If Realtime Global Illumination is not enabled in your Project, this tab will be empty.

The Realtime Global Illumination system is supported in the Built-in Render Pipeline, but not in URP or HDRP. Therefore, this tab is visible only in the Built-in Render Pipeline.

The Baked Lightmaps tab

This tab shows a list of all lightmaps generated by lightmapper for the current Scene, along with the Lighting Data Asset. If Baked Global Illumination is not enabled in your Project, this tab will be empty.

Control area

Controls for precomputing lighting data are at the bottom of the Lighting window.

属性: 功能:
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.

This property is stored in a Lighting Settings Asset. It is visible in the Lighting window only if the Scene tab is selected, and the active Scene has a Lighting Settings Asset assigned to it.
Generate Lighting Click the Generate Lighting button to precompute lighting data for all open Scenes. This data includes lightmaps for the Baked Global Illumination system, lightmaps for the Realtime Global Illumination system, Light Probes, and Reflection Probes.

Click the foldout arrow on the right hand side of the Generate Lighting and then click Bake Reflection Probes to bake only the Reflection Probes for all open Scenes.

Click the foldout arrow on the right hand side of the Generate Lighting and then click Clear Baked Data to clear all precomputed lighting data from all open Scenes without clearing the GI Cache.

This button is enabled only if Auto Generate is disabled.

  • [Lighting Settings Asset] added in 2020.1 NewIn20201
阴影故障排除
Lighting Settings Asset