기술 자료

Unity Engine

Download Unity

Unity Engine

Tune Surface Cache Global Illumination quality and performance

Balance the quality of Surface Cache Global Illumination against its per-frame cost in your scene.
읽는 시간 4분최근 업데이트: 6일 전

The cost of Surface Cache Global Illumination (GI) comes from two separate sources: the ray tracing that builds patch lighting, and the screen filtering that resolves patches to the screen. In general, ray tracing cost scales with scene complexity, while screen filtering cost scales with resolution. Use your platform's GPU profiler to check which one costs more in your scene, then tune that side first.
These steps assume Surface Cache GI already works in your scene. Refer to Set up Surface Cache Global Illumination.

Start from a quality preset

The Quality property sets most of the other properties in the Volume Override at once. Start there, then adjust individual properties only where you need to.
To start from a quality preset, follow these steps:
  1. Select the Volume that includes the
    Surface Cache Global Illumination

    ?

    override.
  2. Set Quality to the preset closest to your target: Low, Medium, High, or Ultra.
  3. Adjust individual properties as needed. Unity switches Quality to Custom as soon as you change a property that a preset controls.
Selecting a preset overwrites every property it controls, including values you set yourself, so choose the preset before you fine-tune.
Presets don't size the volume for your scene. Set Size, Cascade Count, and Focus Target separately, as described in the following sections.

Visualize the patches your settings produce

To visualize the patches your current settings produce, follow these steps:
  1. Go to Window > Analysis > Rendering Debugger.
  2. Select Surface Cache.
  3. Set View Mode to Cell Index.
Each patch appears as a distinct area. Use this view to judge whether patches are small enough where the player looks, and whether you're spending detail on surfaces that don't need it. As a starting point, a patch size between 0.25 meters and 0.5 meters works well for many scenes, but the right size depends on your project. Refer to Rendering Debugger window reference for URP.

Cover a long view distance

For scenes with a large depth range, such as an open world, increase the number of cascades rather than enlarging the volume uniformly.
To increase the number of cascades, follow these steps:
  1. Select the Volume that includes the Surface Cache Global Illumination override.
  2. Increase Cascade Count.
Cascades distribute patch detail by distance, so you get small patches near the camera and large ones far away. This reduces the total number of patches compared with covering the same distance at a uniform resolution, and it extends the effective range of the volume.

Reduce the number of patches

To lower the cost further, shrink the region that uses patches and let a cheaper approximation handle the rest.
To reduce the number of patches, follow these steps:
  1. Select the Volume that includes the Surface Cache Global Illumination override.
  2. Reduce Size so the volume covers only the area that needs accurate indirect lighting.
  3. Enable Distance Fallback.
Distance Fallback lights everything beyond the volume with a single real-time probe calculated from the environment. Lighting in the distance is less accurate, but the patch count drops, which improves performance.
You can combine this with a higher Cascade Count. The two approaches work together, and most large scenes need both.
As a last resort, you can also lower Resolution, which reduces the number of patches in every cascade. This costs spatial detail everywhere, so prefer the volume and cascade adjustments first.

Follow something other than the camera

By default, the cascades center on the active camera, so the finest lighting follows wherever the camera is. To center them on a GameObject instead, set Focus Target to that GameObject.
This property appears only when you edit a Volume in a scene, not when you edit a Volume Profile asset.

Reduce ray tracing noise

If lighting looks noisy or reacts too slowly, and ray tracing is your bottleneck, follow this general approach:
  1. Increase Sample Count as high as your target performance allows. Measure in a build, not in the Editor.
  2. Reduce filtering, such as Temporal Smoothing or Spatial Filtering, until the result just starts to look unstable.
This gives you the least filtering, and so the fewest filtering artifacts, that your Sample Count budget allows.
Spatial filtering hides noise but blurs fine detail and can increase light leaking, so increase Sample Count first if you can afford it. Temporal filtering also increases input lag, so increase Sample Count before relying on it too.

Reduce screen filtering cost

If screen filtering is your bottleneck, increase Sample Count first and reduce filtering as described in Reduce ray tracing noise, since a noisier upstream result also costs more to denoise downstream. Beyond that, reduce Lookup Count or Denoising Pass Count, or both.
You can also lower Render Scale in the URP Asset. This renders your scene at a lower resolution and upscales the result, which reduces every per-pixel cost in your frame, not just screen filtering.

Additional resources