Directional light bleeds into closed corridor HDRP

Hey everyone,

I’m running into an issue with my directional light and with a particular corridor on my level. It seems the first half of the corridor is light by the directional light, while the last half is completely dark as it should be.

The first example is how it looks from the outside, completely covered with the ceiling and walls.

On the second example the corridor interior is completely lit while it should be dark. I have no idea why this is happening to only half of the corridor.

I set up a reflection probe to help with the light and it did but only for the other half of the corridor.

What can I do in this case?

Thank you in advance

You need either a double sided material or make wall geometry for both sides. Otherwise it will leak.

2 Likes

Hi Bordeaux_Fox, sorry for the late reply! Could you kindly let me know what you mean by wall geometry for both sides? You mean make a plane or something to block the light before it reaches the wall?

The double-sided material didn’t do the trick unfortunately.

Thanks

Yes, for interiors you need geometry that blocks the sun light or basically any light source. Because usually a mesh is only rendered from one side, the light will leak through the side which is not rendered. Therefore, you need wall inside a corridor and then also for outside corridor. So instead of plane, make a cube, basically a mesh with a thick solid volume.

Not this will not block reflections from the sky, so you still get some light leak. To get a perfect pitch black room, you also have to place reflection probes inside a room that covers the walls and floors.
Also this method does not prevent light leaking when use Realtime GI with Enlighten.

6108342--664989--light_block.png

Ohhh I see, I’ll give this method try when I when I’m out of the daily grind, thanks a bunch for your help.

S

So I did all of this and nothing was working, I couldn’t really understand why, I also set up reflection probes in each area that have different lighting conditions.

Out of frustration I enable and disable the Directional Light to see how much it was affecting the map and when I turned it back on, it started working properly… No light leak anywhere. So I guess that worked!

Thanks man!

…because I forgot the update mode was “On Enable”… Game dev is hard, but sometimes it’s just because you’re kinda dumb huh