Troubleshooting lightmapping quality issues
Optimize baking

Troubleshooting light leaking

If you use baked Global Illumination (GI), troubleshoot light leaks.

Lightmap leaking

Lightmap leaking results in noticeable lighting discrepancies in dark indoor areas adjacent to bright outdoor lighting.

Symptoms

Light leaking appears as unwanted illumination in shadowed areas due to incorrect 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 assignment.

  • Aliasing and pixelation in baked lightmaps.
  • Console warnings about overlapping UVs. Example error message: Warning: UV overlap detected on the following GameObjects: [GameObject Name].
  • Red highlights on affected texels in the SceneA 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
    view’s UV Overlap draw mode or Baked Lightmaps Preview.
Mesh with leaking artifacts.
Mesh with leaking artifacts.
The same mesh without leaking artifacts.
The same mesh without leaking artifacts.

Cause

  • Incorrect or inadequate lightmap UVs.
  • Low lightmap resolution.
  • Small margins between charts.

Resolution

To resolve lightmap leaking, do the following.

Adjust lightmap UVs and resolution

You can increase Lightmap Resolution to improve texel coverage and reduce light leaking.

Note: Lightmaps use mipmaps. So, while there may be no leakage at high resolution, leakage can occur when the cameraA component which creates an image of a particular viewpoint in your scene. The output is either drawn to the screen or captured as a texture. More info
See in Glossary
moves farther away and a lower mip level is sampled. Therefore, it’s important to ensure sufficient texel spacing between UV islands depending on lighting conditions.

If you can’t adjust resolution, modify lightmap UVs in a digital content creation tool by following these steps:

  • Split the Lightmap UV Chart at the seam between light and dark areas to prevent light bleeding.
  • Adjust Unity-generated lightmap UVs:
    • Set Margin Method to Calculate and adjust Min Lightmap Resolution and Min Object Scale.
    • Alternatively, set Margin Method to Manual and increase the Pack Margin.
  • Increase lightmap resolution to create more space between charts:
    • Go to the Lighting window and adjust the LightmapperA tool in Unity that bakes lightmaps according to the arrangement of lights and geometry in your scene. More info
      See in Glossary
      Settings
      .
    • For individual GameObjectsThe fundamental object in Unity scenes, which can represent characters, props, scenery, cameras, waypoints, and more. A GameObject’s functionality is defined by the Components attached to it. More info
      See in Glossary
      , increase the lightmap resolution under Lightmap Settings in the Mesh RendererA mesh component that takes the geometry from the Mesh Filter and renders it at the position defined by the object’s Transform component. More info
      See in Glossary
      component.
  • Preview UV overlaps using the UV Overlap draw mode or Baked Lightmaps Preview to verify the issue is resolved.

Adjust filtering settings

High Gaussian filter settings can introduce light leaks. For detailed solutions on adjusting these settings, refer to Troubleshooting lightmapping artifacts.

Adjust scene geometry

Light leaking is often caused by meshThe main graphics primitive of Unity. Meshes make up a large part of your 3D worlds. Unity supports triangulated or Quadrangulated polygon meshes. Nurbs, Nurms, Subdiv surfaces must be converted to polygons. More info
See in Glossary
overlap rather than filtering issues.

To adjust scene geometry, do the following:

  • Ensure that objects don’t intersect or protrude through scene geometry.
  • For interior scenes, avoid one-sided wall meshes. Instead, use extruded meshes to create proper thickness and effectively block light leaks.
Lightmap leaking introduced by high Gaussian filtering settings and poor object placement - left. Open Image Denoiser mitigates leaks, but not entirely - center. Adjusting the Y-coordinate of the affected props so that they dont intersect scene geometry fixes the issue entirely - right.
Lightmap leaking introduced by high Gaussian filtering settings and poor object placement - left. Open Image Denoiser mitigates leaks, but not entirely - center. Adjusting the Y-coordinate of the affected props so that they don’t intersect scene geometry fixes the issue entirely - right.

Light probe leaking

Light probe leaking occurs when a probe from a bright area affects an object in a dark area, or vice versa. This issue is most noticeable near walls or other occluding geometry when the probe density is insufficient.

Symptoms

Objects lit by light probesLight probes store information about how light passes through space in your scene. A collection of light probes arranged within a given space can improve lighting on moving objects and static LOD scenery within that space. More info
See in Glossary
appear too bright or too dark compared to their surroundings. This issue often occurs in enclosed spaces, such as rooms or shaded areas, where light is expected to be blocked but instead leaks in.

Cornell box scene placed in a bright outdoor environment. Due to a sparse Light Probe Group, the probe-lit statue samples a light probe outside, which makes it appear bright - left. Increasing the density of the Light Probe Group fixes the issue - right.
Cornell box scene placed in a bright outdoor environment. Due to a sparse Light Probe Group, the probe-lit statue samples a light probe outside, which makes it appear bright - left. Increasing the density of the Light Probe Group fixes the issue - right.

Cause

Light probe leaking occurs when the interpolation of light probe data incorrectly assigns lighting from one area to another due to low probe density.

This issue commonly arises in scenes with a sparse Light Probe GroupA component that enables you to add Light Probes to GameObjects in your scene. More info
See in Glossary
. For example, in a bright outdoor environment, a probe-lit object in a shaded area can incorrectly sample lighting from a nearby bright probe, making it appear out of place.

Resolution

To resolve light probe leaking in Light Probe Groups, do the following:

Increase light probe density

To increase light probe density, do the following:

  • Add more light probes around the affected object to improve accuracy.
  • If the issue is noticeable near walls, place dense probe clusters along them.
  • To help reduce light leaking, place a buffer of two probes on each side of a wall.

Refer to Place Light Probes with the Editor.

Adjust the Anchor Override property

By default, Unity determines which light probes to sample using the center of the GameObject’s bounding box, which can cause incorrect lighting in sparse probe networks.

To adjust the Anchor Override property, do the following:

  1. Set the Anchor Override property in the Mesh Renderer component.
  2. Assign an existing GameObject or create an empty one to act as an anchor point.

Use Light Probe Proxy Volumes (LPPVs)

The Light Probe Proxy Volume (LPPV) component places probes at a custom density within a GameObject’s bounding box.

Use LPPVs sparingly, as they increase the computational load at runtime.


Did you find this page useful? Please give it a rating:

  • Troubleshooting lightmapping quality issues
    Optimize baking