기술 자료

Unity Engine

Download Unity

Unity Engine

Set up Surface Cache Global Illumination

Enable Surface Cache Global Illumination in a URP project and get real-time indirect lighting in your scene.
읽는 시간 3분최근 업데이트: 6일 전

Surface Cache Global Illumination (GI) needs two project settings, a Renderer Feature, and a Volume Override. This page covers all four, in the order you configure them.
Surface Cache GI replaces baked global illumination rather than adding to it, so before you follow these steps, make sure it suits your project. Refer to Real-time global illumination with Surface Cache.

Prerequisites

Before you begin, make sure that:
  • Your project uses the Universal Render Pipeline (URP).
  • Static Batching

    ?

    is disabled for the whole project. Surface Cache GI doesn't support it. For more information, refer to Enable static batching.

Make mesh data accessible from shaders

Surface Cache GI needs every mesh to be readable from a shader.
To make mesh data accessible from shaders, follow these steps:
  1. Go to Edit >
    Project Settings

    ?

    > Graphics.
  2. In Mesh Settings, set Default Mesh Buffer Target to Raw.
You can't change this setting in Play mode. For more information, refer to Graphics project settings reference.

Add the Renderer Feature

To enable Surface Cache GI for a renderer, add a Renderer Feature to the renderer asset.
To add the Renderer Feature, follow these steps:
  1. In the Project window, select the Universal Renderer asset your project uses.
  2. In the
    Inspector

    ?

    window, select Add Renderer Feature.
  3. Select
    Surface Cache Global Illumination

    ?

    .
The Renderer Feature has no settings of its own. If the Inspector window shows a message about Static Batching or Default Mesh Buffer Target, go back to the previous steps and fix the setting it names. For more information about Renderer Features, refer to Add a Renderer Feature to a URP Renderer.

Add the Volume Override

The Volume Override controls how Surface Cache GI behaves, and which part of your scene it covers.
To add the Volume Override, follow these steps:
  1. In the Hierarchy window, select a Volume. To create one, select
    GameObject

    ?

    > Volume > Global Volume.
  2. If the Volume doesn't have a Volume Profile, assign one in the Inspector window.
  3. In the Inspector window, select Add Override.
  4. Select Lighting > Surface Cache Global Illumination.
  5. Enable the checkbox next to Size, then set a value that covers the part of your scene that needs real-time indirect lighting. Keep the value as small as possible while still covering that area.
Surface Cache GI is active as soon as you add the override. To disable Surface Cache GI for the cameras this Volume affects, set State to Disabled.

Enable real-time lighting in the Scene view

By default, the
Scene

?

view redraws only when something changes, so Surface Cache GI appears not to settle. To see it update continuously, follow these steps:
  1. In the Scene view, select the View Options overlay.
  2. In the Effects dropdown, enable Always Refresh.
For more information, refer to View Options overlay reference.

Results

Your scene now receives indirect diffuse lighting that updates as you move lights and geometry. Lighting takes a few frames to settle, and settles again each time the camera reveals new surfaces.
Unity no longer applies indirect light from lightmaps or Adaptive Probe Volumes to opaque surfaces, so expect the look of your scene to change. To adjust quality and performance, refer to Tune Surface Cache Global Illumination quality and performance.

Additional resources