1. 程式人生 > >Unity Lighting - Light Probes 光照探針(十)

Unity Lighting - Light Probes 光照探針(十)

 

Light Probes 光照探針

 

 

Only static objects are considered by Unity’s Baked or Precomputed Realtime GI systems. In order for dynamic objects such as interactive scene elements or characters to pick up some of the rich bounced light that our static geometry receives, we need to record this lighting information into a format which can be quickly read and used in our lighting equations during gameplay.

Unity的Baked或預先計算的實時GI系統只考慮靜態物件。為了讓動態物件(如互動式場景元素或角色)能夠拾取靜態幾何圖形接收到的豐富反射光,我們需要將此光照資訊記錄為一種格式,該格式可以在遊戲過程中快速讀取並用於我們的照明方程式中。

We do this by placing sample points in the world and then capturing light from all directions. The color information these points record is then encoded into a set of values (or ‘coefficients’) which can be quickly evaluated during gameplay. In Unity, we call these sample points, ‘Light Probes’.

我們通過在世界中放置取樣點然後從各個方向捕捉光線來實現這一點。這些點記錄的顏色資訊隨後被編碼成一組可以在遊戲過程中快速評估的值(或“係數”)。在Unity中,我們將這些取樣點稱為“光探針”。

 

descriptionScene using Light Probes. Notice how they have been placed in greater density around areas of lighting change - such as shadows or color transition.

使用光照探針的場景。注意它在光照變化區域以更大密度放置 - 例如陰影或顏色過渡區域。

Light Probes allow moving objects to respond to the same complex bounced lighting which is affecting our lightmaps regardless of whether Baked GI or Precomputed Realtime GI is used. An object’s mesh renderer will look for the Light Probes around its position and blend between their values. This is done by looking for tetrahedrons made up by the position of Light Probes, and then deciding which tetrahedron the object’s pivot falls into. This allows us to place moving characters in scenes and have them appear properly integrated. Without Light Probes, dynamic objects would not receive any global illumination and would appear darker than surrounding, lightmapped geometry.

光照探針允許移動物體響應同樣複雜的反射光,無論是使用烘焙GI還是預計算實時GI產生光照貼圖。物件的MeshRenderer將在其位置周圍尋找Light Probes並在它們的值之間進行混合。這是通過尋找由光探針位置組成的四面體,然後決定該物體的樞軸落入哪個四面體來完成的。這使我們能夠在場景中放置移動角色使它們看起來得到恰當的效果。如果沒有光探測器,動態物體將不會接收到任何GI全域性照明),並且會比周圍的光照貼圖幾何體看起來更暗。

By default there are no Light Probes in a scene so these will need to be placed using a Light Probe Group (GameObjects>Light>Light Probe Group).

預設情況下場景中沒有任何光照探針,需要通過光照探針組來放置(GameObjects>Light>Light Probe Group)。

If the ‘Auto’ box is checked at the bottom of your scene precompute settings (Lighting>Scene>Auto), Light Probes will update whenever changes are made to the scene lighting or static geometry. Otherwise they will be updated when the Build button is clicked.

如果在場景預計算設定(Lighting>Scene>Auto)底部選中“Auto”,則只要對場景照明或靜態幾何進行更改,光源探針就會更新。否則,它們將在點選生成按鈕更新。

Further Reading 進一步閱讀

In this document we have given an overview of the considerations which need to be made prior to setting up a scene for lighting. We have also briefly looked at the tools available for creating various lighting effects. However, there is still a lot which we haven’t yet covered.

在本文中,我們概述了在設定照明場景之前需要考慮的事項。我們還簡要介紹了可用於建立各種照明效果的工具。但是,還有很多我們尚未涉及的內容。

For a more in-depth look at optimizing your Scenes for Unity's Precomputed Realtime GI please see our tutorial here.

要更深入地瞭解如何優化Unity的預計算實時GI場景,請參閱我們的教程。

 

來源: https://unity3d.com/cn/learn/tutorials/topics/graphics/light-probes?playlist=17102

<wiz_tmp_tag id="wiz-table-range-border" contenteditable="false" style="display: none;">