Dynamic Lighting that works Indoors and Outdoors? Sky Light Alternatives?

Hey everyone,

as already noted in the title, I’m looking for a good way to handle dynamic lighting in open and closed environments. It’s easy to set them up to look good indoors, it’s easy to set them up to look good outdoors. But how do I handle both at the same time? I tried adjusting the lights values and post processing stuff whenever I go into an indoor environment or back out again, but this of course doesn’t work for example when looking into a room from outside or looking outside from within a room.

Using Light Propagation Volumes is giving me some nice results even without the use of a sky light, but their range is too limited to be used for big, open environments. Not to mention issues with light bleeding et cetera.

In short, is there any way to block sky lights or only apply them to a specific area? Are there any alternatives for skylights that are not applied globally to the whole scene? What would be your recommended workflow for dynamic lighting that works both outdoors and indoors?

I understand your issue really well. I’m trying to deal with the same setup. So far, I do not know any way to do this “right”. It will never be as accurate as lightmass, of course.

The best I can do is - “Lower Hemisphere is Black” on skylight = off and make sure lower part of your sky sphere is some mid range value. This will fake the “bounce”. Then I use combination of DFAO and HBAO (see NVidia thread) to give it some large/mid scale occlusion + “ambient lights”, which are movable point lights with min.roughness = 1, shadows off, inverse square = off, and using small falloff value.

But yeah, I agree, having “light blocking volumes” would be awesome, as you’ll have full control over the brightness of certain areas.

Maybe someone else has a better approach, would be nice to hear :slight_smile:

Thanks for the reply, BrickTop, I’ll definitely try out some of your suggestions.

Using “ambient lights” helps in some areas, but in others it’s impossible to place them without also illuminating areas that should be dark. Taking my screenshot above as an example, I see no way of placing ambient lights to brighten up the shadows outside the cube without also hitting the inside. But maybe that’s just a limitation of the engine after all.

Thanks for sharing your approach in any case. It would indeed be nice if others could chime in with their experience as well.

I found a somewhat dirty method not too long ago. I didn’t try it extensively so I’m not to sure of the cons, but give it a try if you want. I got the idea after playing some Battlefield 4.

Set up your scene and skylight for how you like it outdoors, but make sure the skylight is set to stationary and not dynamic (the AO node in materials won’t work otherwise). Make a master material for any assets that would be used outdoors and indoors, and hook up a scalar parameter to the Ambient Occlusion node. For indoor assets apply a material instance with the AO set to 0, and for outdoor assets apply a material instance with the AO set to 1 (You can let a little ambient light in if you make it a number in between). You can make a special transition doorway with an AO map. Then you’d need a special volume that changes the AO parameter on BeginOverlap and EndOverlap for any dynamic objects that enter the interior.

If you wanted to get really fancy, you could make a bool bInterior and make the AO scalar parameter a material collection value that only affects bInterior assets. This could allow you to control the interior ambient light for the whole map.

That sounds like a neat workaround, I’ll give that a shot once I’m back in Unreal.

It’s probably going to require quite a bit of work to separate all the materials and create those transitions, but at least it would fix the issue entirely!

I just gave it a shot, but it doesn’t seem to be working:

My skylight is set to stationary, the left cube material has a AO value of 1, the right cube material an AO of 0. Both look the same. I tried plugging in a vector instead of a scalar parameter, but that also changed nothing. What does change though is that using a stationary sky light doesn’t work with Distance Field Ambient Occlusion, which is a painful trade-off to make. One I probably would be willing to make though, if it means I can make dark indoor environments.

Hmm, not sure what your doing wrong. I opened up the starting level in 4.9, added a skylight set to stationary, made a white material with AO set to 0 and it’s working.


Yes, unfortunately you have to chose between DFAO and material AO which is a real shame.

Weird. I’ll give it another shot later today. I’m currently still on 4.8 since I can’t use LPVs in 4.9 due to a bug with translucent shaders. But I’ll test it with clean new projects in both versions and report back what I get.

I’ve done it in 4.6, so the technique should work in any version I would think.

Have you considered playing around with HDR settings, perhaps an ambient cubemap could help?

I think the problem he has is that Skylight doesn’t cast shadows so it always effects interior. HDR won’t help with this. In our custom deferred renderer we solved it by having a different set of materials for interior and exterior, interior materials would ignore ambient contribution from sky but receive sun light which can be blocked by shadow.
Something like Light blocking volume would be indeed necessary in this case. Otherwise use a separate material for interior with very low ambient value, in principal your interior should be darker than exterior in shadow, this is not the case right now.
What else UE4 - DFAO could be used for interior when you outside and then switch to AO as you walk into interior.

To add to this, in case you get this working and you don’t want both DFAO and the material AO, you can disable DFAO on a per mesh level by setting mesh DFAO resolution to 0 in Build Settings.

I just tried again with fresh materials and it’s working now. I think the issue before was that the materials were set to metallic and reflected the environment, looking identical as a result.

Thanks for the advice everyone. I guess I’ll have to start adjusting my assets to have indoor and outdoor materials separated!

So how will you prevent dynamic entities from glowing bright indoors?

As Kyben pointed out I will need to set up trigger volumes for the interior spaces that change the AO value of the material of any object that enters or leaves.

DFAO is literally exactly what you’re looking for, use it with a moveable skylight. Unfortunately it’s not quiiite fully production ready. But hopefully will be so once development on it resume.

Hey guys looking at your screenshots I’m noticing that the scenes are very bright. It looks like you haven’t put any reflection captures in the scene, and thus the whole scene is using the Sky for reflection with full intensity. As of 4.9 reflection captures work with static lighting disabled. Hope this helps.

please tell what did you found for?

Unfortunately I still don’t have a good solution for this. Light Propagation Volumes received a few updates that are very helpful, especially the occlusion and fade range features, but it’s far from perfect. Distance Field Ambient Occlusion might work well for some projects, but it produces too many artifacts to be useful for me.

Either way I still have to manually adjust the skylight intensity and other parameters via trigger volumes for different locations. It’s a mess, really, but I guess that’s just what it takes to get decent dynamic lighting in an open world.

thank you!