本文档主要是对Unity官方手册的个人理解与总结(其实以翻译记录为主:>)
仅作为个人学习使用,不得作为商业用途,欢迎转载,并请注明出处。
文章中涉及到的操作都是基于Unity2018.3版本
参考链接:https://docs.unity3d.com/Manual/GlobalIllumination.html
The Lighting window (menu: Window > Rendering > Lighting Settings) is the main control point for Unity’s Global Illumination (GI) features. Although GI in Unity gives good results with default settings, the Lighting window’s properties allow you to adjust many aspects of the GI process, to customise your Scene or optimise for quality, speed and storage space as you need. This window also includes settings for ambient light, halos, cookies and fog.
光照窗口(菜单:窗口>渲染>照明设置)是Unity全局照明(GI)功能的主要控制界面。虽然Unity中的GI在默认设置下提供了很好的效果,但是光照窗口的属性允许你调整GI处理的许多方面,来定制你的场景,或者根据你的需要优化质量、速度和存储空间。该窗口还包括环境光、光晕、剪影(cookie)和雾的设置。
Overview 概述
The controls of the Lighting window are divided among three tabs:
The window also has an Auto Generate checkbox below the displayed content. If you tick this checkbox, Unity updates lightmap data as you edit the Scene. Note that the update usually takes a few seconds rather than happening instantaneously. If you leave the Auto Generate box unticked, the Generate Lighting button to the right of the checkbox becomes active; use this button to trigger lightmap updates when you need them. Use the Generate Lighting button if you want to clear the baked data from the Scene without clearing the GI Cache.
该窗口还在显示内容下方有一个自动生成复选框。如果你勾选这个复选框,Unity会在你编辑场景时自动更新光照图数据。注意,更新通常需要几秒钟,而不是立即发生。如果不勾选“自动生成”框,复选框右侧的“生成照明”按钮将变为活动状态;当你需要的时候,使用这个按钮来触发光照图更新。如果您想在不清除GI缓存的情况下清除场景中烤好的数据,请使用Generate Lighting按钮。
Scene tab
The Scene tab contains settings that apply to the overall Scene, rather than individual GameObjects. The Scene tab contains several sections:
Environment 环境
The Environmental Lighting section contains settings for the skybox, diffuse lighting and reflections.
环境光照部分包含天空盒、漫射光照和反射的设置。
Property | Function |
---|---|
Skybox Material | A skybox is a Material that appears behind everything else in the Scene to simulate the sky or other distant background. Use this property to choose the skybox Material you want to use for the Scene. The default value is the Material Default-Skybox in the Standard Assets. |
天空盒材质 | skybox是出现在场景中其他对象后面作为背景图的一种材质,用来模拟天空或其他遥远的背景。使用此属性可选择要用于场景的skybox材质。默认值是标准资产中的材质 Default-Skybox |
Sun Source | When a procedural skybox is used, use this 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 default), the brightest directional light in the Scene is assumed to represent the sun. |
太阳光源 | 当用可计算方式(procedural )shader的天空盒时,使用指定带有方向光组件的游戏对象来指示“太阳”的方向(或指照亮你的场景的大的、遥远的光源)。如果设置为None(默认),则假定场景中最亮的方向光代表太阳。(其他类型光源也可赋值) |
Environment Lighting | These settings affect light coming from the distant environment. |
环境光 | 这些设置会影响来自远处环境的光照。 |
Source | Diffuse environmental light (also known as ambient light) is light that is present all around the Scene and doesn’t come from any specific source object. Use this to define a source colour. The default value is Skybox. |
源 | 漫反射环境光(也称为环境光)是指存在于场景周围且不来自任何特定光源的光。用这个来定义源颜色。默认值是Skybox。 |
-Color | Select this to use a flat color for all ambient light in the Scene. |
-颜色 | 选择此选项可为场景中的所有环境光使用单一颜色 |
-Gradient | Select this to choose separate colors for ambient light from the sky, horizon and ground, and blend smoothly between them. |
-渐变 | 选择这个选项可以从天空、地平线和地面为环境光选择不同的颜色,并在它们之间平滑地混合。 |
-Skybox | Select this to use the colors of the skybox (if specified by the Skybox Material) to determine the ambient light coming from different angles. This allows for more precise effects than Gradient. |
-天空盒 | 选择此选项可使用天空盒的颜色(如果由指定的天空盒材质)来确定来自不同角度的环境光。这允许比渐变更精确的效果。 |
Intensity Multiplier | Use this to set the brightness of the diffuse environmental light in the Scene, defined as a value between 0 and 8. The default value is 1. |
强度乘数 | 使用此设置场景中漫反射环境光的亮度,定义为0到8之间的值。默认值是1。 |
Ambient Mode | Use this to specify the Global Illumination mode that should be used to handling ambient light in the Scene. This property is only available when both real-time lighting and baked lighting are enabled in the Scene. |
环境模式 | 指定全局光照模式被用于何方式处理场景中的环境光。此属性仅在场景中启用实时照明和烘焙照明时可用。 |
-Realtime | Choose Realtime if you want the ambient light in the Scene to be calculated and updated in real time. |
-实时 | 如果想要实时计算和更新场景中的环境光,请选择实时。 |
-Baked | Choose Baked if you want the ambient light to be precomputed and set into the Scene at run time. |
-烘焙 | 如果你想让环境光在运行时已被预计算和设置到场景中,选择烘焙。 |
Environment Reflections | These settings control global settings involved in Reflection Probe baking, and settings affecting global reflections. |
环境反射 | 这些设置控制反射探针烘焙中涉及的全局设置,以及影响全局反射的设置。 |
Source | Use this setting to specify whether you want to use the skybox for reflection effects, or a cube map of your choice. The default value is Skybox. |
环境反射源 | 使用此设置可以指定是使用天空盒进行反射效果,还是使用立方体贴图。默认值是天空盒。 |
-Skybox | Select this to use the skybox for reflections. If you select Skybox, an additional option called Resolution appears. Use this to set the resolution of the skybox for reflection purposes. |
-天空盒 | 选择这个来使用天空盒进行反射。如果选择天空盒,会出现一个名为分辨率(Resolution)的附加选项。为了反射的目的,使用它来设置天空盒材质的立方体贴图的分辨率。 |
-Custom | Select this to use a cube map for reflections. If you select Custom, an additional option called Cubemap appears. Use this to set the cube map of the skybox for reflection purposes. |
-自定义 | 选择此选项可使用立方体贴图进行反射。如果选择自定义,还有一个称为立方体贴图的附加选项出现。为了反射的目的,使用它来设置天空盒的立方体贴图。 |
Compression | Use this to define whether or not reflection textures are compressed. The default setting is Auto. |
压缩 | 使用它来定义反射纹理是否被压缩。默认设置为自动。 |
-Auto | The reflection texture is compressed if the compression format is suitable. |
-自动 | 如果压缩格式合适,则对反射纹理进行压缩。 |
-Uncompressed | The reflection texture is stored in memory uncompressed. |
-未压缩 | 反射贴图存储在未压缩的内存中。 |
-Compressed | The texture is compressed. |
-压缩 | 贴图被压缩。 |
Intensity Multiplier | The degree to which the reflection source (the skybox or cube map specified in the Reflection Source property) is visible in reflective objects. |
强度乘数 | 反射源(反射源属性中指定的天空盒或立方体贴图)在反射对象中可见的程度。乘数因子 |
Bounces | A reflection “bounce” occurs when a reflection from one object is then reflected by another object. The reflections are captured in the scene through the use of Reflection Probes. Use this property to set how many times the Reflection Probes evaluate bounces back and forth between objects. If this is set to 1, then Unity only takes the initial reflection (from the skybox or cube map specified in the Reflection Source property) into account. |
反弹 | 当一个对象的反射被另一个对象再次反射时,反射“反弹”发生。反射通过使用反射探针在场景中捕获。使用此属性可以设置反射探测在对象之间来回弹跳的次数。如果设置为1,那么Unity只考虑初始反射(来自反射源属性中指定的天空盒或立方体贴图)。 |
Realtime Lighting 实时光照
Realtime Global Illumination:
If this checkbox is ticked, Unity calculates and updates the lighting in real time. See documentation on Realtime Global Illumination for more information.
如果勾选这个复选框,Unity会实时计算和更新灯光。有关更多信息,请参阅有关实时全局照明的文档。
Mixed Lighting 混合光照
Baked Global Illumination:
If this checkbox is ticked, Unity precomputes the lighting and sets it into the Scene at run time. See documentation on Baked Global Illumination for more information.
如果选中这个复选框,Unity会预计算光照,并在运行时将其设置到场景中。有关烘焙全局照明的更多信息,请参阅文档。
Lighting Mode:
Lighting Mode determines the way Mixed Lights and shadows work with GameObjects in the Scene.
Note: When you change the Lighting Mode, you also need to re-bake the Scene. If Auto Generate is enabled in the Lighting window, this happens automatically. If Auto Generate is not enabled, click Generate Lighting to see the updated lighting effect.
光照模式决定了混合光照与阴影在场景中的工作。注意:当你改变光照模式时,你还需要重新烘焙场景。如果在照明窗口中启用了自动生成,这将自动发生。如果不启用自动生成,单击Generate Lighting查看更新后的灯光效果。
Realtime Shadow Color :
Define the color used to render real-time shadows. This setting is only available when Lighting Mode is set to Subtractive.
定义用于渲染实时阴影的颜色。此设置仅在光照模式设置为减色化(Subtractive)时可用。
Lighting Mode | Function |
---|---|
间接烘焙 | 直接光照:实时,间接光照:烘焙贴图和光照探测器,无阴影烘焙,实时计算 |
减性 | 静态物体烘焙: 直接光照和间接光照,动态对象:接收实时直接光照,使用场景主平行光对静态对象投射。有阴影烘焙到光照图 |
阴影遮罩 | 直接光照:实时,间接光照:烘焙贴图和光照探测器。烘焙阴影:生成阴影遮罩(shadowmask)和光照探测器。运行时的阴影遮罩模式可在 质量设置 设置。 |
Lightmapping Settings 光照图设置
Lightmapping Settings are specific to the Lightmapper backend. Unlike other settings, they’re not shared and have their own parameters. To see full settings information for each lighting system, see documentation on Progressive Lightmapper and Enlighten.
Lightmapping设置特定于Lightmapper后端。与其他设置不同,它们系统间不是共享的,独立的参数。要查看每个光照系统的完整设置信息,请参阅有关渐进式Lightmapper和Enlighten的文档。
Other Settings 其他设置
This section provides documentation for the Other Settings section.
Property | Function |
---|---|
Fog | Enables or disables fog in the Scene. Note that fog is not available with the Deferred rendering path. For deferred rendering, the Post-processing fog effect effect might be suitable. |
雾 | 启用或禁用场景中的雾。请注意,对于延迟渲染路径,Fog不可用。对于延迟渲染,可用后处理雾效果。 |
Color | Use the color picker to set the color Unity uses to draw fog in the Scene. |
颜色 | 雾的颜色 |
Mode | Define the way in which the fogging accumulates with distance from the camera. |
模式 | 雾效果计算方式 |
Linear | Fog density increases linearly with distance. |
线性 | 随着距离线性提高雾浓度 |
-Start | Set the distance from the Camera at which the fog starts. |
-开始 | 开始出现雾时与相机距离 |
-End | Set the distance from the Camera at which the fog completely obscures Scene GameObjects. |
-最终 | 被雾完全遮挡场景物件时与相机距离 |
Exponential | Fog density increases exponentially with distance. |
指数 | 随着距离指数级提高雾浓度 |
-Density | Use this to control the density of the fog. The fog appears more dense as the Density increases. |
-密度 | 用这个来控制雾的浓度。随着密度的增加,雾显得更浓厚了。 |
Exponential Squared | Fog density increases faster with distance (exponentially and squared). |
指数平方 | 随着距离提高雾浓度更快(指数平方级) |
-密度 | 用这个来控制雾的浓度。随着密度的增加,雾显得更浓厚了。 |
-Exponential Squared | Fog density increases faster with distance (exponentially and squared). |
Halo Texture | Set the Texture you want to use for drawing a Halo around lights. |
光晕贴图 | 设置一个绘制光晕环绕光源的贴图 |
Halo Strength | Define the visibility of Halos around Lights, from a value between 0 and 1. |
光晕强度 | 定义光晕的可见性:0-1(有点放大缩小的意思) |
Flare Fade Speed | Define the time (in seconds) over which lens flares fade from view after initially appearing. This is set to 3 by default. |
眩光淡化速度 | 定义镜头眩光在最初出现后从视野中消失的时间(以秒为单位)。默认设置为3。 |
Flare Strength | Define the visibility of lens flares from lights, from a value between 0 and 1. |
眩光强度 | 定义镜头眩光的可见性:0-1 |
Spot Cookie | Set the Cookie texture you want to use for spot lights. |
聚光灯剪影 | 设置用于聚光灯剪影的纹理。 |
Debug settings 调试设置
Property | Function |
---|---|
Debug Settings | Settings that help you debug your Scene. |
Light Probe Visualization | Use this to filter which Light Probes are visualized in the Scene view. The default value is Only Probes Used By Selection. |
光照探头可视化 | 用它来过滤在场景视图中哪些光照探头是可视化的。默认值仅供选择使用。 |
Only Probes Used By Selection | Only Light Probes that affect the current selection are visualized in the Scene view. |
只有被选择使用 | 只有影响当前选择的光探头才能在场景视图中显示。 |
All Probes No Cells | All Light Probes are visualized in the Scene view. |
无数据的全部探头 | 场景视图中全部探头 |
All Probes With Cells | All Light Probes are visualized in the Scene view, and the tetrahedrons that are used for interpolation |
of Light Probe data are also displayed. | |
有数据的全部探头 | 场景视图中全部探头,用于插值的四面体光探头信息也显示。 |
None | No Light Probes are visualized in the Scene view. |
无 | 不显示 |
Display Weights | When ticked, Unity draws a line from the Light Probe used for the active selection to the positions on the tetrahedra used for interpolation. This is a way to debug probe interpolation and placement problems. |
显示权重 | 当勾选时,Unity从用于活动选择的光探针绘制一条线到用于插值的四面体上的位置。这是一种调试探针插值和布局问题的方法。 |
Display Occlusion | When ticked, Unity displays occlusion data for Light Probes if the Mixed lighting mode is Distance Shadowmask or Shadowmask |
显示遮挡 | 勾选此项时,如果混合照明模式是距离阴影遮罩或阴影遮罩,Unity会显示光探头的遮挡信息 |
Global maps tab 全局映射
Object maps tab 对象映射
在Unity2018.3被 Realtime Lightmaps与baked Lightmaps替换, Ojbect的lightmap可在对象本身的meshRenderer组件中看到。