Download

Best way to implement dynamic indoor lighting?

My game is set in a house at night. Player can switch lights in different rooms and all objects in rooms can be moved (including furniture), it’s similar to Phasmophobia lighting. So I can’t bake lightning. My current setup is movable light (lamp) in each room and skylight. But shadows are almost purely black (skylight doesn’t help a lot - it’s unnoticable at lower values and too hursh on high values). I tried to experement with LPV but it seems to only work with directional light
Isn’t in UE4 something similar to Unity’s realtime GI? My PC is powerful so technically I can use raytracing, but I don’t want it to be the game for “elite” gamers, I want to make it runnable on as large hardware range as I can

They only realtime GI we currently have is LPV and DFGI, both are kinda experimental. Waiting for the UE5 release might be the right way for you. UE5 will support GI and many other useful features. Since you will be able to use your UE4 project also in UE5, technically you can start with UE4 now and upgrade your project later to UE5.

1 Like

Given the state of .26, the chances that ue5 will magically solve all your problems are a nice -100%.
As in, keep dreaming.

You are pretty much stuck with the default.

Shadows and whatever else for Point Light are usually OK. Just disable precompiled lighting and whatever is left is going to be dynamic, even if it uses cascade (which is basically trash and you’ll have to adjust for issues like banding).

Watch this for some examples of issues you may get and ways around them.

1 Like

Yeah, RT shadows are pretty good (and seems like not that expensive). But shadows aren’t the main problem here, indirect GI is. And since UE4 currently doesn’t have any non-high-end solution for dynamic GI, I need to fake it somehow. Maybe there are some techniques for such things? A lot of games have good dynamic indoor lightning

I’m not enteiely sure what you mean.

Moving a movable light at runtime affects the scene as you would imagine.
It may not give you light bounce off reflective surfaces, but there’s usually no visual need for it (as in you can’t really tell in a game where stuff moves and your attention is on the action taking place).

Adding in a skylight and setting it to movable is usually enough for most scenes. It gives you some arbitrary control over the overall darkness of the shadows.

Your use case is a closed environment too, so usually you want absolute pitch dark (no skylight, or intensity 0).

Either way, a movable skylight allows you to adjust the intensity at runtime. So you can leverage that.
In .26 it also re-captures with the atmosphere, which does tent to create more natural scenes (if not for the fact that the engine version sucks and is very unperformant).

On the other hand, if you are hoping to either get emissive materials to illuminate the area, or the movable light to bounce a bit off reflective surfaces, you really need LPV.
This requires a lot of stuff…

  1. distance fields.
  2. proper values for the distance field resolution on each mesh (setting those up tends to make a drastic difference).
  3. properly set up meshes that affect (or do not) the distance fields.
  4. properly balanced scene lights.
  5. a runtime change of the LPV intensity based on whatever parameters you see fit (like room size, because it handles how far you see stuff too).

LPV affects the global bounce. And the scene look somewhat drastically.
It can work well when tuned, and look absolutely horrible when you first turn it on.

It does tend to bounce all sorts of light like crazy. Well, in my case anyway, with emissive materials providing most of the lighting… placing a blue emissive engine in the middle of 100x100m room will turn all the walls from white to blue… it’s not “incorrect”, it’s just way, way more than one would expect.

Also, it is technically experimental, and I bet they will remove all of it eventually since it hasn’t really caught up in 5 or 6 years - despite being the only way to do emissive movable materials that light up the environment somewhat.

It’s true, in usual scenes dynamic lighting looks good even out if the box, but it’s not the case for me. The environment is night, so no directional light and very dark sky. The only light source in the room is a lamp, so because of this lighting looks very harsh (well-lit objects with pitch-black shadows). I have a skylight, but it uses sky as a color source and because of this doesn’t do much. And with higher intensity it just turns black shadows to blue-ish shadows

I’m aware of LPV, but it only works with directional lights (maybe I’m missing something, but I couldn’t make it work with point lights)

I’m already using distance field shadows and DFAO (and in fact they give the same results as RT shadows)

Emissive materials are used to light up environments? I didn’t know about it. I’ll look into it

I’m doing indoors of a first floor of a house. So far what worked for me is adding rect lights on top of the roof pointing down (somehow they light even through the ceiling) I have a rect light per each space of the first floor, and then added the direct light which is the one giving GI to light up the whole scene, I removed the skylight because it blows all my characters lighting. So to sum up, I am only using rect lights and a direct light. I haven’t tweaked much in the Post process volume but I guess I will start doing it now, by the way, maybe you can add many post process volumes per each part of the place you want to play with the lights in, and tweak the Gi in there individually if you want control on a separate level.

@OP
If the light cannot be moved at runtime (and even then with scripting) why not just change the direction of a directional light - kept very faint ofc - to have the same end point as the interior light?

As far as your skylight giving you colors, that’s normal. You can override the color it injects via the settings.
The blue is usually because you are reflecting off the sky.

Emissive LPV is great for things like monitors, screens, just about anything that can cast a very wide array of colors that normally light the surrounding area.

You could set the lightbulb of the lamp to an emissive value of 100 or so, and cheat the soft lighting effect with that - but it isn’t directional.

Ue5 might do something, if im reading it right, but walls are naturally thin, and voxels dont like thin objects. Plus, we dont even know how high quality lumen is as the demo scene would cover up any errors, so its more like a 5% then a 0%. Better than lpv, but not by a large margin.

This feels like arguing semantics. but sure. The epic team isn’t completely asleep at the wheel - I hope but the forums would prove me wrong… So there’s about a snowball’s chance in hell.

LPV doesn’t like thin objects either… any Volume doesn’t like thin stuff.
My modular walls that seem to work have a minimum thickness of 10cm - but default resolution scale for the DF.

Either way, it’s not “impossible” to do a good job within the engine confines just because we don’t have a fully functional and all encompassing CORRECT gi.

there’s literally tons of UE4 games that are “only interior” and do a great job at things - including performance (many are given off as freebies by epic, I think Close To The Sun was)

I think the one I have to praise the most so far was Outerworlds (definitely wasn’t a freebie).

The common trend is that they are all super cartoony compared to other titles.

Hellblade: Senua’s Sacrifice
is probably the only current example of a well made - top graphics - decent performance - Realistic (at times) looking game.

So crazy good looking things that run in older engine version are possible. it’s just about how much time and effort you put into it (and team size/skills).

Custom base material + light probe system…
Or a true GI solution, there’s not much else to it.

What gives you a better lighting solution is not increasing the light intensity but increasing the indirect lighting.

My fav as to indirect lighting.

Dynamic lighting on the other hand is more about lighting behaviour as an object or character moves with in the effected area as to lighting effects that needs to be staged and to account for this need there is the option of using lighting channels available to control the intensity object based

For our project we have reserved channel 2 for any object the needs focused lighting

Ok, thanks everyone for replying. It seems that all dynamic GI solutions are currently half-usable or too niche (LPV acts unpredictable and weird and is being deprecated, SSGI and RTX are DX12 only and too niche)
So I decided to use hybrid system. Since the house and room themselves are static, I’ll bake indirect lighting for empty rooms and use importance volume for furniture. And I’ll also put PP volume in each room to control GI intensity

You can take a look at RTXGI RTX Global Illumination | NVIDIA Developer
I believe there is an Nvidia branch of UE4 with it integrated already. It runs on newer AMD cards as well.

1 Like

That sounds like a pretty good solution IMO!

Another tool that’s sometimes useful is to use a non-shadow-casting key light. For example, if sun is from the south and slightly orange, make a much softer light from the north that’s blue-purple, and doesn’t cast shadows, to use for lightening up the darkest parts. You may even want to of them – one from northwest, and one from northeast – to avoid getting “black” glancing surfaces.

This is what I was about to suggest, that and AO or DF AO for certain objects should do the trick, not sure about performance though.