How to block skylight in indoor environment?

There’s is no trick that will get you close to modern engines solutions for full dynamic lighting and makes your scenes to look like this : https://www.youtube.com/watch?v=Ggy1SGsez4U
A scene like this looks pretty outdated in UE4. Raytracing could help but not if it needs a specific GPU.

You are joking right?
you just shared the worse game of last year.
using the dot solution will work exactly like that…
Same for the line trace to the sun.

I’m talking about lighting here, not gaming.
I really would like to see how your solution look like.

Most MMORPGs use some type of internal cell system to block all outside light/sound and clipping from geometry, and from my old Wow modding days you can also bake different lights into the cells. Star Wars Galaxies used this same internal cell system to clip out rock geometry where you planted a house or built Cities. All lighting was baked internally and sounds from outside were also muffled compared to standing outside, was brilliant stuff.

Its a bit deeper than that. You would do an octree implementation that checks cells for shading and a multitude of other settings.
in ue4 gaphically cutting out rocks is possible by simply masking out via a render target applied in world space.
The collision remains however, so you’d have to either script a mesh cut along (which can be done, its just a bit painful) or swap to cpp and rewrite half the engine to accommodate.

Companies with a budget always do this anyway. It’s not like Anvil (engine used by ubi in *** creed) wasn’t heavily customized to handle shoreline water shaders, dynamic shadows etc.
it’s just that the game is pathetically bad in a lot of things if not all things rendering. Odissey was clearly much better made.

As far as to how the dot solution.
it works for entering/leaving the demo cave. I’ll film a clip for you.
It’s pretty much what you see when entering the house, except ther’e no extra light from other doors in this case.

To get the house going I’d have to replicate the house first. And I would really go with the trace to the sun system for it so you can increase/lower the effect based on the angle you look as well. Looking up where you know is dark could result in light getting even brighter for instance. Different overall situation.

What do you mean by “outdated”? I think it would look fine

What is your setup please. Full dynamic lighting? Raytracing? LPV? other realtime GI solution?

I confess it is not “fully” dynamic in that interior skylight shadowing is provided by a stationary skylight. Meaning it wouldn’t work for a game with procedurally generated levels, or for something like fortnite where players can destroy most of the map and build their own structures.

The interior “bounce” light is just faked with two unshadowed point lights, their intensity is controlled by blueprint using a float curve and a normalized time of day scalar (seen in the upper left corner) as input. Other than SSGI I don’t know of any non-raytraced realtime GI solution that offers any noticeable indirect shadowing detail so in my opinion unshadowed point lights are basically as good as anything else. Speaking of SSGI, Unreal has it so you can use that too, I turned it off because I felt it washed out the lighting in this particular scene.

Everything else is just the magic of auto-exposure.

Stationary skylights are underrated in my opinion. I get it, no one likes baking lighting, especially for an open world. But if your primary issue is simply shadowing the skylight in a game where the majority of content is artist placed (which I assume AC qualifies, been a long time since I played an AC game), it provides beautiful results.

Yes, obviously baked looks better than realtime when you can afford insane lightmaps building time, heavy lightmaps, memory cost, etc. which is mostly never the case of large open worlds.
SSGI has a lot of issues, it breaks SSAO and of course has all the screenspace issues.

Memory cost can be reduced by using streaming virtual textures for lightmaps. No idea what “heavy lightmaps” means, lightmaps are easily the most cost efficient way to light a scene which is why we’re still using them, decades after they were first conceived.

But yes, building/iteration time is the biggest cost.

Literally every realtime GI method has a lot of issues. I’ll be shocked if Lumen “just works” without any caveats or compromises.

You should have ended that sentence right there :stuck_out_tongue:

Build time on a single 8km^2 with a normal amount of vegetation is about 3 hours on an i7 without networking anything else in. Yes, if you do boneheaded stuff you can cause the time to dilate into eons.

That said.

I really don’t see what the gripe is.
you can achieve a complete dynamic scene by just changing the values of the skylight based on whatever you want - and add the eye adaptation on top of it, so the transition is even softer.
Or you can disable eye adaptation entierly. Which may be better in some instances.

curious to see a working example with doors and windows :wink:

Exactly. By “heavy” I meant that while it’s ok for small scenes, it’s totaly out of budget for large open worlds

Yes. I don’t see how tuning the skylight intensity based on any calculation could look close to other advanced realtime lighting technics used in other modern games (even not so modern as some of those technics has been used for years now). Your IBL intergration is the closest thing I’ve seen in Unreal.

I’m optimistic!

3 hours is reasonable in my opinion, but much as I love lightmaps, if you want to reduce build times you can safely do so by just not building lightmaps for foliage.

Foliage typically doesn’t get as much benefit from surface lightmaps because they (usually) have too many UV islands and most of the texture space just gets wasted on padding. And anything smaller than a tree won’t be contributing much to the volumetric lightmap so you don’t even need to use the volumetric lightmap for them. Even for trees you can safely leave them with fully dynamic lighting, as they’re not solid occluders the lack of skylight occlusion isn’t very noticeable.

If you’re only interested in baking down lighting to get interior skylight occlusion then you can disable lightmaps for most of the scene, including foliage. Then everything else will just use dynamic lighting which is I assume what you’re already doing, except now you’ll also have skylight occlusion.


Don’t get me wrong, I also wish we had more tools to address this so that we could pick and choose what tradeoffs we were willing to accept. I’m not particularly thrilled with the options we currently have and if I felt like I had a better option than baking lighting, I would take it in a heartbeat.

My only point is that UE4 does at least have some solutions that can work and look similar if not better than what you posted. Does it have drawbacks? Obviously. But real-time rendering is built on a mountain of “good enough” approximations, clever tricks, and dirty hacks. EVERY solution is going to have downsides that won’t be acceptable for every project, including any realtime-GI implementation.

Borderlands 3 is openworld, and it used baked indirect lighting from the SUN. Which is much more time consuming to build than a 0 bounce skylight. It can be done. The only question is what you’re willing to accept and unfortunately as things stand right now, while we do have some working solutions, we don’t have many options to choose from.

Alright. Here’s a vid showing the component in action.

In general, as far as baking lights, definitely only on trees, and not all of them at that either.

@ do those 2m wide holes on 1m wide walls count as windows/doors? :stuck_out_tongue:

1 Like

I just so happened to be googling results for how to do this, and you JUST happened to post this this morning. Splendid! Thank you for sharing, I hope this helps me!

Pseudo-code around 2 pages back.

Another option would be a post process area that alters the lut table or eye adaptation. Or idk. There’s so many options you could play with that would render what you need as you need it. Including the baked light for interiors described above.

The theory is sound because usually houses have some form of internal lighting. Be it candles, bracers, torches, gas lamps, or light bulbs…

The interior lighting is flat, it’s not dark from outside, it has the same skylight intensity than outdoor (which is really low. What happen with an outcast weather with a lot of ambiant light?).
What we need to get closer to other engines is skylight occlusion. DFAO helps a bit but it lacks of precision.

yes your windows are fine. your result however isn’t

what you show here is not bad but for me it doesn’t really work
for one you’re not even showing the outdoors once you’re inside, and when you transition back outside your camera is only showing the inside. you’re missing the key part of looking out from your overly lit interior, and seeing the effect of that overly brightened skylight on your outdoor scene. that’s what normally makes the effect fall apart (and why the doors and windows are key)

but also your regular outdoors skylight is so dark that when you peek inside it’s already very dark, and you actually have to *brighten *your skylight in order to see inside (and your almost pitch-black cave entrance shows how problematic this is). that’s exactly the opposite of what’s been discussed in this thread :smiley:
the issue at hand here is to be able to have a brighter exterior ambient light - a brighter skylight that actually allows you to see something in the shadows, or even allowing an overcast lighting… with the ability to also have properly dark interiors.

TL;DR the desired end result is a brighter [actually visible and art-directable] exterior ambient light and a darker [approximating a naturally occluded] interior ambient light, with optionally enough of a light brightness difference to cause eye adaptation make the outdoors even brighter when you peek out from inside and the indoors darker when you peek in from outside.

… you make 0 sense. My art direction is why my outside is dark. You could flip the variables around and achieve the same end result.

Regardless, in my current setup when you look outside the map is overly lit. Which is pretty much how it really is when you look outside from a dark room.

If your setup is opposite and you make the inside of the house darker, then obviously the outside would be darker as well.

In that case, you just fix it with a post process for the interior since it’s got nothing to do with dynamic lighting but with wierd art direction that’s opposite to normal.

  • and as far as the light of the interior being flat *
    there are no light sources in the interior and the value is overly exaggerated to demonstrate. On top of a ■■■■ texture that’s got very light normals.
    If you add a torch the interior would obviously look much better and probably not even need the component at all.