NEED HELP - Lighting inside room with movable door

Hello dear community,

this is my first post. I am looking for a solution to this issue online and trying out different settings for over a week now, but without success.
I am trying to create an enclosed room with a door that can be opened and closed by pressing the F key. So far so good.
Now I want

  • the room to be completely dark when the door is closed.
  • a movable shadow of the door on the floor and walls when I open and close the door (So far achieved with directional light set to movable)
  • the sunlight to enter the room and illuminate the floor when the door opens
  • the sunlight to reflect of the floor and walls and overall brighten the room when the door is slowly opened

Now I almost achieved what I want by setting the directional light to movable and Directional Light - Cascaded Shadow Maps - Num Dynamic Shadow Cascades to 4.
Cascaded Shadow Maps are set to 4 to remove the light bleed at the seams of the door.

Here with Num Dynamic Shadow Cascades to 3 (bleed) and 4 (no bleed)

](filedata/fetch?id=1842231&d=1607720609)

Somehow my character and some materials still reflect light… But that is the furthest I got and I was almost happy with it…

I tried messing with Lightmass Importance Volume, Volumetric Lightmap Detail Cell Size, Post Process Volume, Directional Light, Static / Stationary / Movable / Walls and Light, Sky Light, Sky Sphere, Sphere Reflection Capture, Specified Cubemap… and maaaany more.

Now all I wanted to achieve was to illuminate / brighten the inside of the room when the door opens and have it completely dark when the door is closed.
You know, like a realistic room… So I tried with Dynamic Indirect Lighting and later also Ray Tracing.

Dynamic Indirect Lighting makes the room brighter but somehow it ignores walls when hit from the outside. Walls will illuminate and glow when hit by direct lighting when indirect lighting is enabled. Somehow the light passes through the walls and makes the walls themselfes brighter. You can see this in the following picture where the directional light is behind the walls (static, movable does not matter)

https://forums.unrealengine.com/core/image/gif;base64
​​

When the movable directional light is infront, it almost works.

Please excuse that I switched materials multiple times between screenshots and that the floor material tiles (and walls) are not the same material (the white on the floor left to the building is just a different material).

So now I tried ray tracing which also does not work…

I see that many many people have this problem and ask in the forums but so far there is NO SOLUTION anywhere.

So please provide and example of how to do this. Only thing I can think of is to fake interior lighting by increasing the brightness of a hidden light inside the room when opening the door.

Please please please, there has to be a better way!

I really hope this thread does not die like all the other threads.

Thanks in advance,
greetings Escore.

I’m not sure about all what you want to do, but it seems like in the course “Your First Hour with Unreal Engine” in lesson “Visual Control”.
Please try…

Hello and thank you for your answer. I have watched the video after you suggested it on https://learn.unrealengine.com/ but their solution to brighten the scene was a sky light. I already played around with the sky light, but unfortunately it is not satisfying. The skylight also illuminates the inside of the room when the door is closed, which is not what is expected.

The only thing I could think of was to add a hidden light source inside the room that increases in brightness as the door opens or decreases as it closes, but this is a quick and dirty and bad solution. Overall this would not be satisfying.

That is why I played around with dynamic indirect lighting, but unfortunately it shines through walls.

So unfortunately the problem is not solved with your answer. Anyone else has an idea?

Dynamic global illumination is what you want, but, well, your gonna have to wait for unreal engine 5 or try your luck with light propagation volume for that. Other engines dont fare well either on that.

amazing ideas!

Why did you comment this?

Has noone ever made a game in Unreal Engine 4 like that??
A game that contains a completely dark room?
Where light only shines into it when you open the door to another room?
Where you can close the door and it becomes dark again??
What about all the Horror games out there?

There has to be a solution, even if it is not dynamic indirect lighting (which exists in UE4!).

So I am still looking for a workaround or how to solve the problem with indirect lighting, because I know there has to be one, besides waiting for UE5 (which looks amazing by the way).

Anyone?

This is your best option, I hate to disappoint you but gamedev is literally full of hacky solutions like this. We can’t really render things “the right way” because we have to do it within realtime framerate budgets which is usually impossible and so everything we do is our best approximation using whatever clever solutions we can come up with.

Your result can be improved by pairing this with a stationary skylight (with bounces set to 0) and screenspace GI. When the door is open a stationary skylight will provide you with indirect light from the sky, SSGI will provide bounce light from the sun when the camera is facing it, and a low intensity point light will serve to simulate additional bounce lighting that can’t be represented by the SSGI.

This is happening because you don’t have a reflection capture inside the room, so it is reflecting the skydome from outside. That being said this is still a tricky problem even with a capture inside, normally you have to do two reflection captures, one for the door open and one for the door closed and enable/disable each depending on the state of the door.

Light bleeding from cascaded shadow maps can usually be resolved simply by having thicker walls. You’ll find that many features in UE4 rely on having fairly thick geometry to avoid artifacts (such as volumetric lightmaps)