Version: Unity 6.6 Alpha (6000.6)
Language : English
Save and load lighting settings with Lightmap Parameters Assets
Shadows

Troubleshooting direct, indirect, and environment noise

Fix issues causing speckled noise in lit scenesA Scene contains the environments and menus of your game. Think of each unique Scene file as a unique level. In each Scene, you place your environments, obstacles, and decorations, essentially designing and building your game in pieces. More info
See in Glossary
.

Cause

Example: All sample counts are set to 8 (left). All sample counts are set to 2048 (right).

The Progressive LightmapperA tool in Unity that bakes lightmaps according to the arrangement of lights and geometry in your scene. More info
See in Glossary
is a Monte Carlo path tracer. Insufficient ray counts lead to noisy lightmaps, and increasing the number of rays the lightmapper spawns from each lightmapA pre-rendered texture that contains the effects of light sources on static objects in the scene. Lightmaps are overlaid on top of scene geometry to create the effect of lighting. More info
See in Glossary
texel helps to reduce the noise in the lightmaps.

Resolution

To fix the issue of too much noise, you can increase the sample size from direct, indirect, and environment sources to reduce lightmap noise, and use denoiser and filters. Note that when increasing samples, this will increase bake times in a linear fashion.

Note: To make easier to debug issues, got to the Lighting window, and set the Filtering property to None.

Increase direct samples

Direct samples control the number of rays, which the lightmapper shoots towards light sources.

Example: Scene lit only by direct light. Direct samples are set to 8 (left). Direct samples are set to 2048 (right).

Use this method of increasing direct samples if:

  • Objects lit by area lights produce noisy soft shadows.
  • Baked lightsLight components whose Mode property is set to Baked. Unity pre-calculates the illumination from Baked Lights before runtime, and does not include them in any runtime lighting calculations. More info
    See in Glossary
    with a modified Baked Shadow Angle value are producing noisy results.

Increase indirect samples

Indirect samples control the number of paths, which the lightmapper shoots towards the GI contributors in the scene.

Example: Scene lit only by the indirect bounce light. Indirect samples are set to 8 (left). Indirect samples are set to 2048 (right).

Once these paths intersect geometry, texels spawn rays towards:

  • Environment, which makes it an indirect environment sample.
  • A light source, which makes it an indirect lighting sample.

Paths can bounce off surfaces. Some ways Unity can end a path are:

  • Once it reaches the Max Bounces value.
  • If it doesn’t intersect any geometry.
  • By the Russian roulette algorithm.

Use this method of increasing indirect Samples if:

  • Indirectly lit areas are noisy.
  • Objects using emissive materials produce a lot of noise.

Increase environment samples

Environment samples control the number of rays, which the lightmapper shoots towards the sky/environment.

Example: Scene lit only by environment lighting. Environment samples are set to 8 (left). Environment samples are set to 2048 (right).

Use this method of increasing environment samples if:

  • Baked environment/HDRIhigh dynamic range image
    See in Glossary
    produces noisy results.

Note: that you would need to disable all lights in the scene to verify this.

Use denoising and filtering

Unity can apply a post-processingA process that improves product visuals by applying filters and effects before the image appears on screen. You can use post-processing effects to simulate physical camera and film properties, for example Bloom and Depth of Field. More info post processing, postprocessing, postprocess
See in Glossary
step to remove noise by using filtering or machine learning denoisers.

To enable filtering, navigate to the Lighting window (menu: Window > Rendering > Lighting) and select the Filtering property, and select from three options:

  • None - Disables filtering and denoising.
  • Auto - Attempts to select the best filtering and denoising option based on current system configuration.
  • Advanced - Allows users to fine-tune filtering and denoising properties.

Available filters:

  • Gaussian - Applies a bilateral filter (blur) to the lightmap. This smoothens noise at the expense of visual fidelity. Increase radius parameters to increase filtering strength. High values can lead to leaking artifacts.
  • A-Trous - Edge-aware filter which attempts to remove noise, while maintaining edge definition. Works well with high sample counts and in conjunction with denoising. Doesn’t work well with noisy HDRhigh dynamic range
    See in Glossary
    lightmaps.

Available machine learning denoisers:

  • Open Image Denoise (OIDN) - Machine learning denoiser from Intel. Vendor agnostic. Works on Windows, macOS, and Linux platforms.
  • Optix - Machine learning denoiser from Nvidia. Works only with Nvidia GPUs. Supports Windows only.
  • RadeonPro - Machine learning denoiser from AMD. Vendor agnostic. Works on Windows and Linux.

Experiment with different denoiser and filtering combinations to achieve the best results for your project.

Save and load lighting settings with Lightmap Parameters Assets
Shadows