FPS issues dynamic lightning during sun set/rise


We’re having some heavy framerate issues with our dynamic light setup, but only when our light source is at a grazing angle with the level (sun rise and sun set). There are a lot of tree billboards in the background and I suspect this causes problems with the cascaded shadows. Please see image below for a screenshot with GPU visualizer and light source settings.

Thanks in advance.

Hi Vincent,

Low sun angles are a worst case for cascaded shadowmaps, because a the number of shadow casters which intersect the shadow frusta will be greater. You can probably see that if you look at the number of draw calls with stat scenerendering when the sun is low.

Some titles artificially limit the sun angle to avoid these issues. To reduce the cost generally, you could look at reducing the length or number of cascades in your title generally, or increasing the culling radius (you can change that with the console variable r.Shadow.RadiusThreshold).

You could also potentially look at making making certain meshes non-shadowcasting in certain cases. Reducing masked shadow casters can help a lot, since alpha testing is particularly expensive during depth only passes.

If you have complex meshes which you can identify as taking a long time to render, it may be worth considering shadow proxies for those cases: you can use a simple hidden mesh with Hidden Shadow enabled to provide shadows for a complex mesh with shadow casting disabled. This can be useful for tree canopies with large amounts of overdraw, for example. You can use blueprints to make placement of these staticmesh components more convenient.