天天看點

Lighting Window 光照設定界面 光照系列2

Lighting Window 光照設定界面

本文檔主要是對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 Scene tab settings apply to the overall Scene rather than individual GameObjects. These settings control lighting effects and also optimisation options. 場景頁籤設定應用于整個場景,而不是單個遊戲對象。這些設定控制燈光效果和優化選項。
  • The Global maps tab shows all of the lightmap Asset files generated by the GI lighting process. Global maps頁籤顯示GI照明過程生成的所有lightmap資産檔案。
  • The Object maps tab shows previews of GI lightmap textures (including shadow masks) for the currently selected GameObject. 對象地圖頁籤顯示目前選中的遊戲對象的GI lightmap紋理(包括陰影遮罩)預覽。

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 環境
  • Realtime Lighting 實時光照
  • Mixed Lighting 混合光照
  • Lightmapping Settings 光照圖設定
  • Other Settings 其他設定
  • Debug Settings 調試設定

Environment 環境

The Environmental Lighting section contains settings for the skybox, diffuse lighting and reflections.

環境光照部分包含天空盒、漫射光照和反射的設定。

Lighting Window 光照設定界面 光照系列2
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.

Lighting Window 光照設定界面 光照系列2
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 調試設定

Lighting Window 光照設定界面 光照系列2
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元件中看到。

繼續閱讀