Download

State of skylight interior lighting in 4.15

Hi guys, there is a problem that comes with us since version 4.0 of the engine, we suffer a lot for this since we are developing an open world and we need a lighting solution for interiors and exteriors.

This problem is skylight in interiors buildings.

We have a world composited landscape with foliage and lighting is made by:

  • movable directional light
  • stationary skylight (movable skylight makes everything soo blue…)

Everything works fine, until we build a palace or something similar.

There is NOT a solution to avoid skylight affecting interiors, no one never thought that UE4 should have this feature and this is really struggling me and my team, and I think others suffer for this too since I don’t think we are the only team that is building an open world.

The solution we are currently using is a stationary skylight which builds static shadows to make interiors darker.
Ok, this works. But lightmaps are not memory-free, they use a lot of memory expecially if those buildings are a lot in the map!

Is it possible that there is not a solution for this? A cheap solution?
Yesterday I was looking at PLAYERUNKNOWN’s BATTLEGROUNDS, which is build in UE4 and they have a nice smooth lighting for exteriors and interiors, but I really don’t know how they achieved that.

Is it possible to have an update and know if a solution for skylight exclusion lighting for interiors in large games will be featured in future versions? Something that don’t require lightmaps?

Thank you.

Do you realize you can use hierarchical/composed postprocess volumes for each streamed level/building which you can use to make smooth lighting transitions?!

Unbound for the open world, fixed box size for interiors and with some adjustments you may get a nice lighting for the interior building if you set volume priority and volume settings properly.

We tried postprocess volume for interiors, but that’s not a natural effect, expecially in a running game.
You walk across a door and what? Turning exposure down? This would make you look outdoor and see everything dark, and it wouldn’t be a smooth transition. To smooth it we should use the blend radius and you would see lighting turning off before entering a palace for example.
I don’t think post processes are not a solution, I simply believe that it’s a forced one and not the best

Skylight is a kind of ambient cubemap, so it affects everything in your map.
To fix it maybe you need to use different ambient cubemaps for interior and exterior. Maybe capture it for every interior.
Of course interior post process will affect exterior view in window or door pass so there is no good solution in this case.

I looked video about the game you mentioned, but it looks like they didn’t use any different post process inside buildings. It also looks like they simply made shadows darker.
But I might be very wrong about that…

Anyway, if you want to achieve something you can see in other game - try to use reverse engeneering. :slight_smile:

Unfortunately I am not so expert about reverse engeneering, and I don’t really want to do it, it was just an example of a game made on the same engine. I tried cubemaps on the interior, but they don’t override skylight, so you will basically add ambient lighting info to the skylight… I tried also capturing the room and using it as a cubemap, but it used to flicker and had some artifacts :frowning:

When you trigger the “indoors” PPV, why not just set the skylight to not affect the world anymore? (or turn it’s contribution down). You can even lerp it in the level BP if you want smooth transitions. Basically, you’d need an unbound PPV for the outdoors, a PPV that encompases the entire indoor area and within that indoor PPV, near the “entrance” of that area, you’d have another PPV. The last PPV would be near the entrance would be for when you are near enough to the “door” that you can see outside. As you wanted in further, it would switch to the actual indoor settings. So if you went to turn back around and go outside, you’d end up walking into the “transition” volume and that would turn the skylight’s affect world back on.

I don’t know for sure, but something along those lines should work. Either that or just use a sub-level. In the persistent level, you’d have the basic overall form of the house or cave or what ever. Make a big trigger box near the entrance(s) and as someone gets near enough that they could see detail inside, you’d load the sub-level and do some PPV blending like I mentioned earlier.

Moral of the story: You’ll have to either disable the skylight from affecting the world or you’ll have to play with post-process settings and lower the amount of ambient influence the skylight has.

We built a system which works exactly how you explained it, but it caused performance drop on lerping skylight values unfortunately…

I mean remove skylight and use ambient cubemap for exterior also.

Then fake the transition another way. Switch the skylight directly off and switch on some kind of ambient light inside, then fade THAT light down. If you do your color matching correctly, it should barely be noticeable. Just play with auto-exposure while the transition is occurring.

Also, make sure you switch off any stuff like DFAO and far shadows BEFORE you start lerping the skylight. If you had DFAO going, while it was trying to do that, you’d probably be hard-forcing the engine to update the DFAO every frame. r.DistanceFieldShadowing and r.DistanceFieldAO can be toggled on/off in blueprints with the console command node. Oh and you can also just disable the skylight’s shadow which will kill off the DFAO as well.

We don’t use DFAO, just a stationary skylight with static shadows on, dynamic shadows off.
It seams to be heavy to change skylight value at runtime.

This is a typical problem with indoor/outdoor scenes. I (mostly) solved it with a combination of things, but most importantly was setting up cube shaped reflection captures to match the shape of the interior. This darkened things quite a bit for me.

Could you explain better your method please? It would be great to know how you handled it!

There are not a lot of options for you in a scenario like that!

When I still worked at my old company, we worked on Dead Island 2 with Unreal 4 and it was supposed to open world as well. Sadly, Unreal 4 doesnt support open world lighting techniques atm so you can either hack something together that kind of works, or you implement your own solution (which is what we did in the end)

First of all…some basics!^^ Why do you get blue light inside your interiors?

The skylight supports static, stationary and movable. Static and stationary…everything you see there is just a preview UNTIL you bake the lighting! This is the reason why your interiors are blue! Unreal doesnt know about those walls blocking the light from the sky if the data hasnt been baked. If you use a static or stationary skylight, the blue bright light will go away inside the buildings as soon as you bake. However, there are 2 things that will be very hard for you in that case: 1. you need working lightmaps, otherwise everything will look super broken! 2. Lightmaps is the least favorable approach for doing open world games since you will run into the situation where you cant bake all that data anymore or run into memory troubles with streaming TONS of lightmaps etc. This is actually the reason why almost every open world game uses dynamic lighting and then implements very specific custom solutions to not get bright blue interiors^^

Something you can consider to solve your problem: Use a movable skylight and enable Distance Fields! This way, you get occlusion data for dynamic lighting based on distance fields and you can use distance field ambient occlusion to make interiors look dark because they can dynamically occlude the skylight.

There is a big downside to that though: You will not get any GI! Thats the reason why you would have to invest in custom solutions. One thing you could try is to enable LPVs in Unreal and combine them with distance field lighting. LPVs can make GI but only for the sun…no local lights are supported. You also might end up getting light bleeding inside buildings because of the technical limitations of LPVs (mainly low rez)

What we did for Dead Island 2 was to use distance fields for shadowing and we implemented our own irradiance probe volume approach for localized GI for the sun and local lights. So we basically stored local color bounces from lighting inside probes that we placed in the level and those were then shadowed by distance field AO. However, that needs some programming work to be done.

I think trying to combine distance fields with the LPV could be a good start for you…however, I am not a big fan of the LPVs since the tech is not supported anymore and the code is old and hacky and the performance also isnt too great.
But again…fully dynamic open world stuff is basically exactly the thing UE4 is the weakest engine right now, so you might never reach a result that you are completely happy with without having a graphics programmer to provide project specific solutions.

Cheers! :slight_smile:

EDIT: I just had a look at that battlegrounds game, and I am pretty sure that they use LPVs. Of course not a 100% sure, but it looks extremely similar to what we did on Dead Island 2 before we got the custom probes. I also noticed while watching a lets play, that all the buildings are perfectly aligned to the grid! This is why you dont see the typical LPV limitations because the grid of the LPV becomes increasingly more noticeable as soon as stuff is not on the grid anymore. But I was able to spot quite a few artefacts that are very common to LPVs and thus I would say they use those and shadow the skylight with the LPV data. Also, you can see that shadows far away are brighter than we the player gets closer. This is something that happens with LPVs too since they only cover a certain distance away from the camera. So after, lets say 500 units, there will be no effect of the LPV anymore, meaning shadows dont get the additional sky occlusion anymore and look brighter. Hope this helps!

@Daedalus51 that’s some nice insight from a shipped title :slight_smile:

if you double-check the OP you’ll see that he’d like to avoid baked lighting, which is very understandable. So that would take him down the route of a movable skylight + DFAO
however I believe the OP will find that a movable skylight + DFAO will not be enough, as he mentions “a palace” as an interior which makes me think that he has very big interior areas.
the issue with DFAO is that it has a limited range of occlusion, so while small interiors will work great bigger interiors will end up with meshes (ceiling, wall, floor) so far from each other that they will not occlude themselves anymore, which will result in ‘the blue light’ being present everywhere except where ceilings / walls / floors meet together.
the other caveat of DFAO is that it has a limited global range, so if your interiors are big enough the DFAO will disappear in the distance and will quickly catch the eye as they become brighter with the ‘leaking’ skylight

btw LPV or any GI solution only comes for making the interiors bright again, but before that the interiors need to be dark, i.e. not affected by the skylight

I’m also interested in potential solutions, as I also believe that any time-based transition of postprocess and lighting (i.e. you step indoors and everything changes) just doesn’t cut it, as it completely ruins any hybrid areas (i.e. looking through a door or window, whether you’re indoors and looking outdoors, or outdoors looking indoors)

Hehe, thanks man, but sadly, Dead Island 2 was never shipped so far :wink:

Regarding some of your statements, I have to strongly disagree^^ GI doesnt only make things brighter, GI also occludes, thats the logic of light bouncing around, because if it cant go somewhere, it becomes automatically dark there. Thats why Lightmass, which is a GI solver, makes such nice dark corners below stairs for example.

What I am trying to say is, if you have a good GI solver, you dont need anything else because everything that is not direct lighting is GI. This includes things like shadows and AO as well if you take it from a scientific standpoint. However, that doesnt matter too much for us. But again, if you bake Lightmass, you will get dark interiors and that is because the global illumination doesnt bounce around in the building as much as it does outdoors. So any “good” GI package will give you proper sky occlusion since its just a different aspect of the same thing. Funny fact though, most people refer to GI only in the sense of local color bleeding, which makes sense, but still doesnt reflect the full picture :wink:

Regarding LPVs only making things brighter and not darker…as far as I know (but I might be wrong) that is outdated information. I believe I read in the Docs and Update CLs that LPVs support injecting the skylight and shadowing it based on the LPV data. So to my kowledge that should work^^

On the other side, regarding DFAO…you are right that the occlusion distance is limited. However, It still does a fairly good job in my opinion and if you dont build roman domes, you should still be kinda fine I guess? :smiley: Well…in any way, some occlusion is better than nothing, so I think it can be worth a try^^

Cheers! :slight_smile:

Wow, thank you very much for the reply. LPV is too heavy however, expecially with tons of foliage around the world.
For the moment we are baking stationary skylight inside closed levels, I manage to have 2 gb video memory average for lightmaps and textures, because we stream accurately the static lighting levels at near distances, so we don’t have memory problems at the moment even with a lot of baked lighting levels.

DFAO is not working for us at the moment. We use modules for architectural elements and using DFAO generates black terrible spots that remind me abut THE GRUDGE hairs on the walls.

Unfortunately we don’t have a graphics programmer to build a custom solution with light probes, or we would make it (I saw that Ark uses them too).

I think we’ll go on with this solution for the moment, and I hope we’ll see a better solution for open world in the future in UE4.

my bad, I thought the game was shipped :smiley:

I’m focusing on purely dynamic lighting because it seems that’s what the OP is going for (and also relevant to my interests)
While lightmass (or any proper GI solver) will compute lighting in a proper occluding way, the existing dynamic GI solvers in UE4 differ (DFGI only bounces light and adds it to the main scene, though I was wrong about LPV as it seems to occlude properly, no idea about VXGI or Enlighten).
as you say, from a scientific standpoint a proper GI solver would take care of AO and shadows but since all of these are already detached (i.e. direct light/shadows and separately DFAO) it’s only natural that any new dynamic GI solution they’d go for would only be used for bouncing light (as it’s the case with DFGI). this leaves us with DFAO for occlusion of interiors

indeed with some fine tuning it can be made to look better but in my experience any room bigger than 30x30x30 meters will already start leaking the skylight. and if you start fine tuning it you can end up with a shorter global DFAO range. you don’t need to build a roman dome, I believe a big room attached to a long hallway starts causing problems already

it’s still worth a try and it’s better than nothing. I just feel that it falls a little short to call it a proper solution for handling interior/exterior lighting

In this case. Simply do away with using the skylight and add another directional light. Turn its intensity down and set it to not cast shadows.

Hi, if you found your solution - please write about it