Directional light visible in a tunnel

Hello,

I am experiencing a lighting issue in Unreal Engine 5.8. The Sky Light works correctly: the exterior is illuminated and the inside of the tunnel remains dark. However, as soon as I enable the Directional Light used as the sun, the light appears to pass through the tunnel ceiling and walls. The interior becomes far too bright, as if the direct sunlight rays were going through the geometry.

The issue does not seem to be limited to the generated tunnel. I placed an opaque cube in the scene with Cast Shadows and Cast Dynamic Shadow enabled. The cube receives light from the Directional Light, but it does not produce a visible shadow. This makes it look as though the Directional Light’s shadowing is not being calculated correctly, even on very simple geometry.

I have tried several settings. The project initially used Virtual Shadow Maps with r.Shadow.Virtual.Enable=1, and I also tested disabling them with r.Shadow.Virtual.Enable=0. I disabled Ray Traced Shadows both in the project settings and on the Directional Light. Cast Shadows and Cast Dynamic Shadow are enabled. I tested double-sided tunnel materials and enabled Cast Shadow as Two Sided. I also tried Volumetric Translucent Shadow on the tunnel walls, without any improvement.

I removed the fixed exposure used for diagnostics and changed the indirect lighting settings, but this did not affect the issue. The problem clearly comes from the direct rays of the Directional Light. When I remove the Directional Light completely, the tunnel becomes properly dark and the light leaks disappear, but the exterior becomes very flat and the overall scene looks much worse. Using only the Sky Light is therefore not a suitable final solution.

The project uses Lumen. Virtual Shadow Maps have been tested and disabled, Mesh Distance Fields are enabled, and hardware ray tracing is available. The tunnel consists of walls, a ceiling, a floor and portals generated as Static Mesh Components. Even the test cube fails to cast a shadow from the Directional Light, although it is visibly illuminated by it.

What setting could prevent the Directional Light from generating shadows correctly? Is there a specific configuration involving the Directional Light, Lumen, Virtual Shadow Maps or the shadow mapping method that could cause objects to receive direct light without blocking the sun’s rays?

Hello there @Misteur!

The fact that your test cube doesn’t produce shadows rules out most of the usual suspects for an issue like this (the tunnel’s geo, thickness of the walls, two-sided settings, translucency, etc).

First thing that occurs to me, the directional light that’s used like the sun, is it set to Movable or Static? Considering that you are working with Lumen, it should be Movable, otherwise it won’t produce dynamic shadows.

If that’s the case, the next element to check would be shadow scalability, and ensure your scene is not set to any Low values:

If all shadows values are in High or above, then I would go back to the Directional Light, and check it’s parameters tied to CSM and DFS:

If all else fails, I would test a simple version of your setup in a clean, test project, to rule out particular settings to your project, or even an issue affecting your entire engine install.