Download

How to block skylight in indoor environment?

Hi,

Like many people, I have an open world map with some interiors.
To get DFAO and non pitch black shadows (and a decent day/night cycle system), you have to use a skylight.
The problem is that skylight is affecting everything, so my interiors are affected by the skylight.

I know it’s a known problem because I’ve read almost every post about this and there’s a lot.
So here are the advices/workaround I’ve found:

  • Be sure that cast shadow is checked on the skylight : It is but it doesn’t block the skylight, some faces are darker but not the whole room.
  • Use light propagation volume. Maybe I don’t understand how to use it but it doesn’t block the skylight to me. I activated it using the LPV documentation but my interior rooms are still affected by the skylight.
  • Turn off skylight when you enter a room. Could do the trick but the exteriors shadows are pitch black when you look outside from the opened door/window
  • Pray for Epic to add light channels on skylight. Might be long…

So from what I’ve read, there’s actualy no solution at all to make an indoor/outdoor map that doesn’t look ugly or am I missing something?

There is not. You can just use some trick to fake it. We use a baked stationary skylight in our open world, and that’s a waste of memory to me… the engine needs an easier solution for that imho.

You can use specified cubemap (instead of captured), and set it when entering indoor.
Additionally there is one thing with it - tint. Probably it is possible to set some simply white cubemap texture and modify only it’s tint.

Also, in case you use movable sky light, I think it is handy to use simple sky light component inside player character or camera manager, to set/get it’s variables.

If you have a movable skylight, using a postprocess with another cubemap won’t replace the skylight.

Yep, I know.
Btw, you can also create post process component inside camera manager to handle it’s properties in one place ))

The problems comes when you have a day/night cycle in your open world and have to update the skylight parameters

Tim Hobson showed how to light a cave interior in one of the lighting live streams.

^^ you mean this one I guess
https://youtu.be/nm1slxtF_qA - forward to 1:06:41

it’s the postprocess volume solution, but he added a plane with a black color and depthbias to fake the indoor part to look darker when you’re outside, and the material fades as you get closer to simulate the transition
that’s such a cheap hack but I guess there’s currently not many options aside from that

I’d also like to know a better way to do this. (I’ve also seen the stream)

3 years laters there’s still no solution.
Skylight is projecting a captured cubemap on every mesh as ambiant (global) lighting so there’s no way to stop it.
Other games/engine are using light probes, working like reflection capture components but for ambiant lighting instead of reflections.
Unless Epic is doing this in UE4 (which means: if they need it for a future game) you simply can’t do this without ugly tricks (like using volume which will never fit the geometry of your building).
Square Enix did those tricks on Dragon Quest XI (UE4 game) and it looks really bad because when you’re outside and walk close enough to the walls of a house, you overlap those volumes and lighting change with indoor lighting even you’re outside.

Actually you can modify the brush on a volume to fit almost anything. You just need to access the edit geometry and you can cut/slice vertices (or I think even import a brush?).

You should be able to have a postprocess take effect gradually by creating a postprocess material and parametrazing (scalar) a multiplier that you can then handle by way of timeline, or even tick event.

Needless to day this actually simulates or replaces the same effect of the eye adaptation?
In reality, you could probably just adjust the max/min values of eye adaptation with a trigger volume and instantly get adjusted scene interiors/exteriors depending on a variety of things.

How?
well, for one you would need to benchmark your liking.
Interior / exterior values for
dawn
noon
sunset
Midnight
4am - the darkest hour supposedly.
back to dawn.

After you figure out that works for you depending on what you can create a structure or 2 CSV one for interior one for exterior

Then based on the values of the CSV you can make an educated Lerp adjustment to find a value in between or even just softly transition to the desired effect (so that you don’t suddenly go blind when non comes up).

The ability is there, it just takes some brain power and a lot of prototyping to implement to your liking…
that’s true even with postprocess and volumes.

Probably the bst solution is to use manually created localized ambient cubemaps and put them, all in PP material.
Butperformance of such material will depend on numbers of that cubemaps.

the actual proper way would be to use localized IBL probes like in other engines
I made an implementation Localized-IBL implementation - Unreal Engine Forums - but the pull request was rejected by Epic

Your IBL probes work nice, but cause they rely on some default engine probes - they are static. So many people need IBL with dynamic for day/night cycles and so on.
Implementing IBL on PP probably can be really good solutions.

Exactly. UE4 need light probes but dynamic, not static. That’s what’s used in The Witcher 3, light probes almost everywhere and refreshed in realtime so it works with day/night cycles, caves in front of you looks dark, etc.
This has been requested for age but we will never it unless Epic really need it. It could have been usefull for Fortine but because its cartoonish style, I guess it was unecessary realistic feature for them.

If you turn off indirect bounce light on a stationary skylight you can block light using the volumetric lightmaps (probes). It will still work with dynamic day and night cycles. But obviously there wont be bounce, unless you also use LPV.

Could you explain a bit more how to do that?

I have the same situation, I use skylight to have shadows and corners where no light is coming in (but outside, not interior) to be **not **pitch black and to control a minimum of light in the outside world . But there are also houses with bigger entrance, you can look inside and outside. No door, very big entrance. And that the skylight is shine inside the house/rooms is really annoying.
If this is a solution, would be nice to know how to block skylight using “volumetric lightmaps (probes)”.

If someone knows a easy way in 4.25/4.26 please let me know.

.26 brings th near cost-less real time skylight. For dynamic day/night exterior/interior transitions its a fix all

For looking outside from inside, not so much.

Right now I’m using a custom light portal.
my post process (unbound) adjusts based on if you look through the portal (looking at/though the portal toggles a MPC that makes the PP lerp).
This is “ok” but nowhere nere where PBR results are on other engines.
At the same time, a static scene just looks better forom ue4.

I too would be interested in better understanding this LPV way.
however, .26 also supports emissive lighting from materials by default - which you needed to enable LPV on before (and apparently toggle off all settings for lpv on all meshes that aren’t emissive).

my 2c for interior exterior.

​​​​​Make an actor BP. Throw in an arrow.
add a box shape.
add overlap to the box shape (set collision, add event).
add a variable for skylight, expose it so you can pick it in level with the picker/tool selection.
In overlap start set up a check to flag if player is in.
Create a tick event, block it if player isn’t in, otherwise, DOT player forward vector vs arrow forward vector.

With that, you can adjust skylight intensity depending on output.
Remap DTO from. -1 to 1 to 0 to 1, and use that to drive the original skylight intensity up or down simply based on your characters facing direction inside of the box you are in.

Is it perfect? No. Is it better than eye adaptation settings? No. Does it render a little better? Hell yes…

Unfortunatly, it’s only a real time capture from Sky atmosphere and volumetric cloud, it’s not affected by geometry so it doesn’t help with indoor lighting.
I tryied almost every trick I’ve found on the internet for years now and there’s zero serious solution to this problem. Really hope to see this problem “fixed” on UE5

doubt it. If its like .26 they are just going to break the wheel and work a year (or longer) to fix it again :stuck_out_tongue:

I’m happy with my DOT solution, it’s not all encompassing (looking outside when inside has waaay too much glare), but it performs well and makes the environment playable.

It’s probably the same as going outside at 12/high noon, looking at a white surface while the sun shines on it for a couple min, and going back inside.
overly realistic, you hit the coffee able and cuss at it because you didn’t see it.
unfortunately this has the potential of happening in game even during the night cycle. But since it slowly “adapts” you can eventually see just fine.

If you want a more dire solution. Run a trace from the player to the skylight instead of using the dot.
alter the values used to render based on the hit result. If you get a hit you are in a dark area.
The benefit of that is that
a) you automatically know if you are in a shadow (making something like thief).
b) you can account for a TON of situations always by using proper collision channels.

C) you can make a BP you just drop in level that keeps track of everything. Failry simple to do and you can eyedropper select components. Light, skylight, etc. And even run one for every active player controller dynamically if you are making an MMO or something similar.