How do I stop OmniLight bleeding through walls?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By PolyCement
:warning: Old Version Published before Godot 3 was released.

I’m working on a 3D game consisting of corridors which are chained together via instancing to form a maze. The problem is that the OmniLights I’m lighting the scenes with seem to bleed around walls that should be blocking them. Here’s a simplified example (pictured in the editor, but the same happens in-game too):

Lighting bug (shadows enabled)

And here’s what it looks like with shadows disabled:

Lighting bug (shadows disabled)

The wall in the middle should block the light, but instead it just kind of bleeds around the edges. Obviously it doesn’t look great, and in the case of the game I’m working on it makes the exit of each room super obvious. How do I make the OmniLight not do this?

:bust_in_silhouette: Reply From: Zylann

This happens with any kind of light using shadow mapping. A solution is to change the bias, but beware of choosing it right because if it’s too low, you will see artefacts. If it’s too high, you will have off shadows.
Another idea is to give some thickness to your wall, I see it currently doesn’t, which isn’t common in 3D scenes.

Thanks for the reply. The OmniLight doesn’t seem to have a setting for bias (I’m using v2.1.4). Giving the wall some depth works to an extent, but the wall needs to be incredibly thick (almost as thick as the doorway is wide) to prevent light bleeding through, especially if the light is moved closer to the wall.

PolyCement | 2017-11-12 15:23

There is a bias setting, but in 2.1.4 it is called Z-slope scale and Z-offset.

Zylann | 2017-11-12 16:45

I tried tinkering with Z-offset but if I turn it down enough to fix the light bleeding through, i get this weird shadow on the wall facing the light:

enter image description here

PolyCement | 2017-11-12 17:27