This is the documentation for Enlighten.

Indirect lighting issues


This page lists ways to address some indirect lighting issues that might encounter when using Enlighten.

Visible backfaces

Enlighten uses backfaces to determine areas that are outside the world and do not need indirect lighting. 

By default, the precompute treats backfaces as invalidWhen meshes included in the radiosity computation are not closed, invalid back faces are visible. Indirect lighting is invalidated in areas that see the invalid back-faces.

To prevent areas with invalid indirect lighting:

  • if the surface is opaque and the back-side is only seen from outside the world, make sure there are no visible back faces.
  • If the surface is translucent or seen from two sides, use the backfaceBehaviourType material attribute to change the way the backface is treated.

Inaccurate lighting

When the indirect lighting resolution is not sufficient to capture the variation in indirect lighting, the lighting result may be visibly incorrect.

To address this:

  • If the mesh is lit by a lightmap, increase the lightmap resolution, otherwise increase the probe resolution.
  • If the mesh is lit by probes and is large, use per pixel probe lighting.

Probe light leaks

When two probes are placed either side of a wall that separates areas with very different lighting, probe lighting may appear to leak through the wall.

To minimize the effect of this issue, in the area where the issue is visible, increase the indirect lighting resolution so that more probes are placed.

LOD lightmap artifacts

When two meshes share the same lightmap, artifacts can occur due to mesh projection issues.

These appear as incorrect lighting and sometimes extremely dark or bright areas. The behaviour may change when a different mesh LOD is visible.

Lightmap seams

At the boundary between two lightmap UV charts, seams can be visible in the lighting. Enlighten automatically smooths these seems if the pixels along the edge are aligned with each other.

If you need smooth lighting at this type of boundary, make sure the lightmap pixels are aligned along the edge where the two adjacent charts meet.

Lightmap pixel leaks

In the image below shows a simple scene with lightmapped meshes that are included in the radiosity computation. The scene is lit by a single directional light source.

On the left, the area in shadow from the light source is dark as we expect. On the right, the bright light from the far side appears to leak through to the shadowed area.

The floor on the right is composed of a single lightmap UV chart, while the floor on the left is split into two charts. When a lightmap pixel spans both sides of the wall, it takes indirect lighting from both the bright and dark areas, causing the leak.