Download

Dynamic Lighting Solution

So obviously LPV isn’t fully functional yet, I was wondering if anyone found anything passable for dynamic lighting yet? I noticed that directional lights bleed (I have 20cm thick walls and tried 30cm thick as well). For some things lightmaps just don’t work well, and dynamic is the best approach.

Or is there anyway to bake just the GI from lightmass and shadows and everything else are fully dynamic? Maybe something similar to Skyrim? Or GTA 5? I don’t think those games use LPV, but just some kind of dynamic lighting solution.

The only problem I have right now is with the light bleed of the directional light (Basicly just needs to use higher resolution shadow map). Turning up the cascades to max and making sure the directional shadow does not extend any furhter than needed helps quiet a bit as long as you don’t have to large open spaces. It quickly breaks down as you lower the graphics settings though.

Otherwise a fully dynamic solution works quiet well. I have disabled static lighting and enabled the DFAO that was introduced in 4.3.

Could you elaborate on waht you mean by mixing static and dynamic lighting. What you describe sounds like the default setup when you create a new project. You could easily have the skylight and sun be static lights with static shadows and GI and everything else be dynamic. In this setup you can also blend the cascaded shadowmaps to the static lighting in the distance which allows you to pretty much solve the lightbleed you mention.

2596222438.jpg

This is what I mean with the bleeding, it comes from the dynamic shadow distance, the problem with this is, its either 1 or the other, you can’t have tight interior spaces and large spaces, it has to look like **** on one or the other. Is there a way to work around this? Or is it just a trade off?

Why is LPV not functional yet? I did some tests and was quite pleased and impressed with the results.

The light leaks quite a bit right now, I am hoping Epic is working on it, or atleast some type of real time GI, considering they are making Fortnite, which I imagine will be dynamic.

So I just realized a word was censored in my post above. I didn’t type the S word but the C word (Not THAT C word lol. But the one that means the S word)

I just don’t want people thinking I’m being really negative or anything. I’m actually hopeful about finding a dynamic solution and just wondering the best way to avoid the shadow distance ‘leaking’.

The only dynamic lighting solution, besides direct lighting, working currently is the skybox ambient occlusion. High cost, no directionality, builds up sampling over time, and increases cost dependent on certain types of scene complexity (thin objects) but it gets the job done decently.

Hmmmm, ok thanks, I tried that out and it gave me some weird results to say the least, the walls of the building were splotchy and looked ‘animated’ or something, I just took it as an error in the early implementation of it. Thanks for the suggestion though.

Another thing about lighting, are point lights supposed to leak through solid geometry?

For example, I have a small building fully enclosed with 20cm thick walls, but when I placed a point light on the outside I can see ‘preview’ shadows on the inside, on the floor and ceiling and adjacent walls. Is this just how point lights work? I want to make sure its not my meshes, I would like to stay at 20cm thick walls if I can, since any thicker and the walls in a house start to look unnatural.

Thanks

Yea, this is the same light bleed I was talking about. As I mentioned if you can settle with static shadows in the distance you can get rid of the light bleed up close while still getting shadows far away although they will be static. To get this you should use a stationary directional light, enable the option that enables the blending between static and dynamic shadows. After this you can adjust the shadow distance until you get no or very little bleed. There is still a bit of a trade-off between how far away you want dynamic shadows and how much light bleed is acceptable for the given scene.

I would personally use this if I could but in my case to much of the level is semi dynamic so can’t build static lighting. Instead I am currently using 4 cascades and a shadow distance of about 50 - 100 m, works OK as I don’t intend to have to big open spaces but would love to be able to bump up the resolution of the shadow maps for the directional light.

the shadows from the point lights work really well for me. Are the walls closed meshes? How big is the radius of the point light attenuation? Have not tested it but if it’s big enough you will probably get similar problems as with the directional lights.

Or do you mean that you get the text “preview” written in the shadows? If this is the case just do a rebuild and it should get fixed. I get this from time to time even though I have static lighting disabled in the project settings.

The leaking is caused by the cascaded shadowmaps. At one point, dynamic whole scene shadows from the movable directional light switch from the first cascade to the second. That cascade has the same resolution as the first one, but since it has to cover more geo with it, the resolution gets worse, thus the edges of the shadows become so soft that you see this leaking effect.

There is only one way to fix this properly without sacrificing draw distance for shadows or adding more cascades (which is more expensive and you should not do it) and that is increasing the resolution of the cascaded shadow map. Standard is 1024 which is extremely low and actually not really usable for dynamic setups.

Put r.shadow.maxresolution 2048 or 4096 into the consolevariables or type it into the command line and you leaking should be gone :wink:

Oh wow thanks man, I had increased the shadow cascades to 8 in the consolevariables, didn’t know it was that bad, so I reverted it. I just added r.shadowmaxresolution 2048, and it looks great! Thanks a lot!

Currently Epic team is busy with parallel rendering implementation, after they finish it they will start to work on dynamic lighting

Check out this thread for additional information https://forums.unrealengine.com/showthread.php?20626-Question-about-LPV

[SUB][/SUB]This is My Results with LPV + TOD + Distance Field AO + RayTraced Soft Shadows without Cascade.

ede11907fa180bd13966e77b354ad832084c7b2f.jpeg
40230eaf0fd03b173ece47fe3e2ead4a36a23d84.jpeg
5f48d6edfb14024bf024405514bb3af7edf81fe4.jpeg

You can check the my WIP on my signature.
Also, there is some explanation how tweak LPV+Directional Light with PPV to avoid light bleeding.
If you wanna hints or tips, just send me PM.

@Raziєl Can you do a video tutorial on how to set this up

Awesome news on BOTH fronts, ty for sharing ;)!!