Version: 5.5
Lighting Window
베이크된 앰비언트 오클루전

Using precomputed lighting

In Unity, precomputed lighting is calculated in the background either as an automatic process or when manually initiated. In either case, it is possible to continue working in the editor while these processes run behind-the-scenes.

미리 계산된 프로세스가 실행 중일 때 에디터의 오른쪽 하단에 파란색 진행 표시줄이 표시됩니다. 베이크된 GI 또는 사전에 계산된 실시간 GI 중 무엇이 활성화되었는지에 따라 완료해야 하는 단계가 다릅니다. 현재 프로세스에 대한 정보가 진행 표시줄의 위에 표시됩니다.

미리 계산하는 상태를 보여주는 진행 표시줄

위의 그림에서 11개 작업 중 5번째 작업(‘클러스터링’)이 실행되고 있으며, 현재 작업을 마치고 다음 작업으로 넘어갈 때까지는 6개의 작업이 남아 있다는 것을 알 수 있습니다. 다음과 같이 다양한 작업 단계가 있습니다.

미리 계산된 실시간 GI

  1. 지오메트리 생성
  2. 레이아웃 시스템
  3. 시스템 생성
  4. 아틀라스 생성
  5. 클러스터링
  6. 가시성
  7. 광원 전송
  8. 프로브 사면체화
  9. 프로브세트 생성

프로브

  1. 앰비언트 프로브
  2. 베이크된/실시간 레퍼런스 프로브

베이크된 GI

  1. 지오메트리 생성
  2. 아틀라싱
  3. 베이크된 시스템 생성
  4. 베이크된 리소스
  5. AO 베이크
  6. 베이크된 텍스처 익스포트
  7. 가시성 베이크
  8. 직접 베이크
  9. 앰비언트 및 이미시브
  10. 베이크 시스템 생성
  11. 베이크 런타임
  12. 가시성 업샘플링
  13. 간접 베이크
  14. 파이널 개더
  15. 프로브세트 베이크
  16. 합성

미리 계산 시작

Unity 에디터의 미리 계산된 조명 솔루션에서는 정적 지오메트리만 고려합니다. 조명 미리 계산 프로세스를 시작하려면 씬에서 ‘static’으로 표시된 게임 오브젝트가 하나 이상 필요합니다. 개별적으로 또는 계층 구조 패널에서 Shift를 누르고 여러 게임 오브젝트를 선택하여 표시할 수 있습니다.

인스펙터 패널에서 Static 체크박스(Inspector > Static)를 선택할 수 있습니다. 이렇게 하면 내비게이션과 배칭을 포함하여 게임 오브젝트의 모든 ‘정적 옵션’ 또는 ‘플래그’가 정적으로 설정되어 바람직하지 않을 수 있습니다. 미리 계산된 실시간 GI의 경우 ’라이트맵 정적’만 선택해야 합니다.

더 미세하게 조정하기 위해 인스펙터 패널의 정적 체크박스의 오른쪽에 있는 드롭다운 목록에서 개별 정적 옵션을 설정할 수 있습니다. 또한 라이팅 창의 오브젝트 영역에서 오브젝트를 정적으로 설정할 수도 있습니다.

If your scene is set to Auto (Lighting > Scene > Auto), Unity’s lighting precompute will now begin automatically. Otherwise it will need to be started manually as described below.

자동/수동 미리 계산

If ‘Auto’ is checked from the bottom of Unity’s Lighting panel (Lighting > Scene > Auto), then this precompute will begin automatically as a background process whenever changes are made to static geometry within your scene.

However, if Auto is not selected, you will need to manually start a precompute by clicking the ‘Build’ button next to it. This will begin the precompute in much the same way, while giving you control over when this process starts.

Manually initiating a precompute will cause all aspects of your scene lighting to be evaluated and (re)computed. If you wish to selectively recalculate Reflection probes by themselves, this can be done via the drop-down menu next to the Build button (Lighting > Scene > Build).

Enabling baked GI or precomputed realtime GI

By default, both Precomputed Realtime GI and Baked GI are enabled in Unity’s Lighting panel (Lighting > Scene). With both enabled, which technique is used can then be controlled by each light individually (Inspector > Light > Baking).

Using both Baked GI and Precomputed Realtime GI together in your scene can be detrimental to performance. A good practise is to ensure that only one system is used at a time, by disabling the other globally. This can be done by unchecking the box next to either Precomputed Realtime GI or Baked GI from Unity’s lighting panel (Lighting > Scene). Now only the checked option will be present in your scene, and any settings configured per-light will be overridden.

광원별 설정

The default baking mode for each light is ‘Realtime’. This means that the selected light(s) will still contribute direct light to your scene, with indirect light handled by Unity’s Precomputed Realtime GI system.

However, if the baking mode is set to ‘Baked’ then that light will contribute lighting solely to Unity’s Baked GI system. Both direct and indirect light from those lights selected will be ‘baked’ into lightmaps and cannot be changed during gameplay.

Baking ModePoint light with the per-light Baking mode set to ‘Realtime’.

Selecting the ‘Mixed’ baking mode, GameObjects marked as static will still include this light in their Baked GI lightmaps. However, unlike lights marked as ‘Baked’, Mixed lights will still contribute realtime, direct light to non-static GameObjects within your scene. This can be useful in cases where you are using lightmaps in your static environment, but you still want a character to use these same lights to cast realtime shadows onto lightmapped geometry.

GI 캐시

In either Baked GI or Precomputed Realtime GI, Unity ‘caches’ (stores) data about your scene lighting in the ‘GI Cache’, and will try to reuse this data whenever possible to save time during precompute. The number and nature of the changes you have made to your scene will determine how much of this data can be reused, if at all.

This cache is stored outside of your Unity project and can be cleared using (Preference > GI Cache > Clear Cache). Clearing this means that all stages of the precompute will need to be recalculated from the beginning and this can therefore be time consuming. However in some cases, where perhaps you need to reduce disk usage, this may be helpful.

베이크된 GI의 LOD

Unity 에디터에서는 베이크된 라이트맵을 생성할 때 디테일 수준(LOD)을 고려합니다. 직접 조명은 모든 LOD의 실제 표면을 사용하여 계산됩니다. LOD 수준이 낮으면 라이트 프로브를 사용하여 간접 조명을 가져와야 합니다. 그 결과로 생성되는 조명이 라이트맵에 베이크됩니다.

즉 간접 조명을 캡처하려면 라이트 프로브를 LOD 주위에 배치해야 합니다. 완전히 베이크된 GI를 사용하면 오브젝트가 런타임 시점에 라이트 프로브를 사용하지 않습니다.

Lighting Window
베이크된 앰비언트 오클루전