Dynamic Light & Shadow Performance Improvement

I found dynamic lighting and shadowing were just too expensive in UE4/UE3. So we can’t even turn on dynamic shadows of grass in most open-world scenes(due to bad performance). But the dynamic shadow is the most important thing to get a good result when rendering the grass. People always say CryEngine can achieve better results than UE4 when rendering open-world scenes. However, I think the only weakness of UE4’s rendering comparing to CryEngine is poor dynamic light & shadow performance. They can feel free to turn on all foliage dynamic shadows without suffering a large performance hit in CryEngine. And they can afford much more dynamic light sources since no static lighting in CryEngine. As far as I know, Crytek commonly place thousands of dynamic lights in a level of “Crysis 3”. I can’t imagine if we do so in UE4. Though static lighting in UE4 is great, sometimes, we also have to use a few dynamic light sources in a actual game level, but it always bring a noticeable performance hit when several dynamic lights are visible at the same time.

I’m NOT a Cry fan. As a UE4 user, I just hope UE4 will get better.

Here are two images below indicating the dynamic shadow cost in CryEngine 3.8.1:


Shadow On


Shadow Off
Look at the framerates. And we can see how bad grass can look without dynamic shadow (even with SSDO already enabled).

Here is release note of CryEngine 3.8.1, maybe UE4 dev team want to have a glance at it:
http://docs.cryengine.com/display/SDKDOC1/EaaS+3.8.1#EaaS3.8.1-Renderer

I have absolutely no issues with dynamic lighting in UE4. You can place thousands (maybe slight exaggeration) of dynamic lights into a scene, the key to remember is only have a couple of shadow casters, I doubt even crytek can handle thousands of shadow casters. Non shadow casting dynamic lights go through a different process for rendering (Tiled deferred) and as long as your careful with your shadow casters, you can get good performance, I have some areas where I am rendering around 7 - 11 million polys per frame at around 60 - 75fps, Open World fully dynamic lighting, so it definitely is possible

Maybe you got a powerful graphic card. You could afford much more in CryEngine, if you tried place 10+ overlapped point lights with shadow casting over grass field, you wouldn’t see a big performance hit at all.

Either you are running on a Hell of a machine, or on extremely low settings. If I run a simple scene with a landscape,few models <1m polys, a dynamic directional and 2 point lights I have troubles to get 30 FPS at 1080p with a 7970.

+1

I found another topic on it: https://forums.unrealengine.com/showthread.php?71255-Landscape-Dynamic-Stationary-Lights-HUGE-FPS-drop&highlight=dynamic+light+performance

The performance impact of dynamic shadows (especially from translucent objects) is the single biggest weakness of UE4 in comparison to Cryengine and Unity.
Epic has certainly improved dynamic shadows since the beta of UE4. However I don’t understand why this isn’t a bigger focus for them.
To me it would make sense to improve the weakest points of a product to raise its overall quality, rather than focus on its strengths.
The idea seems to be to offer developers more options, which is good. Since the distance field shadows don’t support vertex (wind) animations it doesn’t really help here though.

Agree, and it’s often the crusial point on how game looks.

now, we have 4.9 out and light is still a fps killer in ue4. Also the verry old T3D engine can handle about 500-1000 dynamic lights, and performance at a ati 7770 is still nice.
I work at a open large world, and if i only place 6 lights at a place, i get 20 less fps.
I would wish, that epic improve this problem.

As I said earlier, I have really had no issues with dynamic lighting at all, and I have hundreds of lights in some scenes, once again make sure u limit ur shadow casters as they will kill performance with too many of them, but non shadow casters aint a problem. Now some people above said that I had to have a really powerful machine to pull off what I am doing, yes my development machine does have a Titan X, but im also running on a laptop with a 970M (Still above average GPU). As well as 690GTX, 970GTX and a R9 290X, even the 690 performs quite well.

One thing I did discover just recently in one of my scenes, as lights are only culled by screenspace size, even if they are not visible (and are shadow casting), they will continue to incur a performance cost as they have to render the scene from their perspective. In that scene I had 20+ shadow casting lights and my FPS tanked. Then I implemented a room culling system for culling lights, and now im back up to the sweet spot. This of course won’t work for large open world levels, but instead I use distance based culling as well as limiting the number of shadow casters.

Cryengine3 made their whole lighting system dynamic from what I understand

I agree, some improvements would be nice :slight_smile:

+1, dynamic lighting & shadows could use some more love :slight_smile: Current system definitely needs some performance improvements. I suspect that the current state is probably an effect of years of static-lighting workflow focus in both UE3 & UE4…

I also agree. The lighting in UE definitely needs more love!
It’s lagging behind in terms of lighting when you compare it to Unity or CryEngine (I don’t wanna start an engine war thread again!).
I think it’s a serious issue that needs to be addressed.

Was looking around for ways to battle the unjustified shadow casting cost in UE4, came across this thread and though I’d bump it. Dynamic lighting performance needs some serious improvement. People who are caught with UE4 only won’t notice it, but using other engines makes this UE4 shadow casting cost more obvious.

Here’s something I’m working on in UE4.

Directional light (No shadow casting) 82 FPS

Directional light (Shadow casting) 49 FPS

Something like 40% performance drop for shadow casting from a single directional light.

I think directional light whole scene shadows need more aggressive shadowcaster culling. There is just way to many cases, where shadowcaster gets rendered into the shadowmap, while not casting anything on visible objects.