dynamic shadows faster then stationary shadows?
I am working on optimizing a VR project.
The scene I am working with is containing a large city with a lot of buildings that are static, a few dynamic objects and there are 2 directional lights.
Because I only animate the light color and intensity, I made the 2 directional lights stationary and baked the whole lighting.
The stationary light will only cast dynamic shadows on a few dynamic objects and the rest (about 90% of scene) will use the baked shadows.
With this setup I couldn't get 90 frames per second and I noticed when I switched both lights to dynamic I did get 90 fps.
So in this case it seems that it is faster to calculate the shadow for the whole scene dynamically then using stationary lights. I noticed in the GPU visualizer that when using dynamic lights, that mainly the shadowdepths renders faster then when using stationary lights.
When I open the shadowdepths I see that when using dynamic lights It will have a few large shadow maps for a few "WholeScene split" items.
When using stationary lights the shadowdepths renders slower and it will contain a bunch of smaller shadow maps for each dynamic item in view.
It seems that splitting the whole scene up in a few shadow maps is faster then using more but smaller shadow maps.
When using stationary lights I set the "dynamic shadow distance stationary lights" to zero. This is the only way I found to let the engine use baked shadows for all objects except the dynamic objects. Could there be a way to get the dynamic shadows from stationary lights render faster or should I just use dynamic lights for everything although it seems so inefficient?
Below a screenshot to illustrate the differences in the GPU visualizer
asked Sep 16 '16 at 08:33 AM in Rendering
@geverk answer is not correct. That happens when you have Stationary Light that is affecting a large number of Movable objects. The easiest way of getting into this trouble is using Movable foliage with Stationary light. Just uncheck "Inset Shadows for Movable Objects" in your Directional and you will be ok
yes, that can happens when you have to much light maps, cooked shadows no need to be calculated but need to be loaded, if you have many light maps with high resolution it may become a problem. You can try to solve that with more memory in your system, or limiting the maximum memory usage on your game so (but that may cause problems loading the textures)
answered Dec 04 '17 at 05:30 AM
Follow this question
Once you sign in you will be able to subscribe for any updates here