Download

Looking for suggestions on lighting large landscapes.

So I have a landscape. It’s a large (although not so much by today’s standards) open world cad game. Details aren’t important, however like any car game it has varying areas such as cities, industrial areas, and of course roads.

My landscape is 8192*8192(or something like that) and so if I even touch static lighting Swarm throws a fit and lightmass crashes almost instantly.

I thought I had found my solution with dynamic lighting only, however with those cities, industrial areas, roads, trees, tunnels etc. Frames drop like crazy when the vehicle is moving.

I also thought I’d get fancy and throw in a day/night cycle with cool results.

So, the only way I can get smooth performance again is to turn the shadows to low in scalability settings, unfortunately it looks like a modded ps2 era game.

So ue4 wizards, I ask you. Is it possible with my version of ue4 (4.19) to have the flashiness of dynamic lighting, with no baked textures, AND a large filled-out map? Or have I backed myself into a corner.

Oh, I’ve also tried world comp, but I couldnt get it to separate off my map, so I left it alone.

It’s doable and not too difficult, but some sacrifices have to be made

If you’ve profiled and know that dynamic shadows are the bottleneck, you have a few options(all of which can be combined per your needs and ability):

  • Use a shorter Cascaded Shadow Map distance
  • Use fewer cascade splits
  • Use a lower resolution Cascaded Shadow Map
  • Disable shadows on objects that don’t need it(i.e. meshes that never cast a noticeable shadow)
  • If you have Distance Fields generated, use Distance Field shadows
  • Enable shadow LODs with the r.forceLODShadow cvar with the LOD # of your choice(unfortunately the engine only supports a global LOD shadow, so all meshes would cast a shadow from their designated LOD… even the cars. If you have programmer support, you can get that set up on a per mesh basis or support custom shadow meshes in general)

Chances are, given that it’s a car game and likely moving fast, you should be able to lower shadow resolution and distance for easy gains with minimal visual impact. Plus, if you reduce CSM distance, you also give more resolution back to the shadow that is still being rendered up close.

The direction light also has a shadowing feature called “far shadows”, which allows you to specify additional shadow cascades after the last normal ones where only objects with the flag “render in far shadows” is enabled. This allows you to have increased shadow draw distances only for specific objects, like large structures, while having smaller objects only draw shadows when close to the camera. You can also experiment with ray traced distance field shadows for distant shadows.

If you have a very large number of static meshes, using dynamic shadows will cost even more since it can easily double/triple/quadruple the number of draw calls. For large open worlds you must make everything possible to keep the number of draw calls under control to get good performance (see Fortnite, for example). Prefer using foliage over hand placed meshes when possible (since those use GPU instancing), make sure you are using LODs on everything and learn how to use the Hierarquical LOD system, which is vital for good open world performance.

Also, if possible, make sure to design your landscape so it contains large occluders (mountains, cliffs, valleys, etc.) that limit how much of the world the player can actually see at once. A flat open world is not only boring looking, it’s less performant.

Well thank you for your quick and helpful reply. I tried everything on your checklist, and only noticed incremental improvements. The problem ended up being a large nav mesh. But I will keep your advice in my back pocket for future use, since I can imagine I’ll need it.