Is it possible to increase "Num dynamic shadow cascades"?

Currently, the maximum number of dynamic shadow cascades is 4. This value gives pretty ideal results. However, it is locked to 4 at max, and I wonder if there is a way to increase this number to higher like 5 and 6?
I tried to use console variables and it doesn’t work since the slider is locked from 1-4 so I have to unlock the slider to get higher value. I am curious about this because I saw it is here:

In the performance section, it says directional light with 6 cascades. It is 2 levels higher than the default maximum number. So I think it is possible to do it and my PC is good enough to handle it.(Dual E5 with Titan black)
So I need instructions to to it, thanks in advance.

Hi Netseeker,

By default this is set to 4 cascades.

This can be increased by using the console command r.Shadow.CSM.MaxCascades. You can set this, I believe, up to 10 max.

Thank you!

Tim

Thanks Tim, I will try it!

Hi Tim, I have tried both using console command and adding r.Shadow.CSM.MaxCascades=10 in consolevariables file. However, none of the worked as it should. I restarted editor several times and delete and place new directional light many times as well. But still the cascade of light is limited to 4 and I cannot make it up higher than 4. Did I do something wrong?

What is the output log showing? You can open this window by going to the Main Menu > Window > Developer Tools > Output Log. Type in the console command r.Shadow.CSM.MaxCascades ? This will show you what it is currently set to. If this can be set to above 4 then it’s good.

As for the Directional light, the slider is locked to stay within 0 and 4. To use the additional cascades you will need to manually type the value in by clicking on the slider. Maybe this is what you’re seeing that’s not working?

Let me know.

Hi, Tim, thank you for being so active. I did exactly as you said above. I typed r.Shadow.CSM.MaxCascades ? in the console command, and the log showed: Cmd: r.Shadow.CSM.MaxCascades ?
HELP for ‘r.Shadow.CSM.MaxCascades’:
The maximum number of cascades with which to render dynamic directional light shadows.
r.Shadow.CSM.MaxCascades = “4” LastSetBy: Scalability
And I typed r.Shadow.CSM.MaxCascades 1, it worked like I used the slider to change the value to 1, no problem at all, and the log showed:
Cmd: r.Shadow.CSM.MaxCascades 1
r.Shadow.CSM.MaxCascades = “1”
When I typed r.Shadow.CSM.MaxCascades 10 again, the log showed me:
Cmd: r.Shadow.CSM.MaxCascades 10
r.Shadow.CSM.MaxCascades = “10” And I got clear shadows and more cascades there. It seems working right now. But the problem and what confuses me are that when I change the cascades number to something above 4, it will not make any difference than what 4 does. I changed from 4 to 10 and each time I changed the value, the output log gave me results and it looked works but I don’t see any difference in visual aspect. Also, in order to get it clear, I lowered the camera speed to 1 and I carefully looked the shadow from the nearest place and gradually zoomed out to check the actual cascades number. As far as my eyes can tell, I only see the 4 cascades when I set the cascade number to 10. I double checked it and I only saw shadow transition happened 4 times indicating only 4 cascades. Did I miss something? I am really confused about this, any clarification would help.

Here’s a simple gif cycling through the cascades. I’ve adjusted it so they are a little easier to see the transition.

In this You can see that the more cascades add just a little bit of extra detail being added for each additional cascade. As you go from 7- 10 you may not notice any difference at all in my simple scene, whereas this may be more visible in more complex scenes though.

You can also use the view mode > Show > Advanced > Shadow Frustums to see a visual representation of the shadow cascades and the lights shadow. With this view enabled. you can start at 0 and add additional cascades to see the representation that will be drawn.

Thank you so much. Now I am not confused anymore because I know it is working and the results are too subtle for my eyes to catch the changes in detail. This really helps me a lot and I hope you guys at Epic Games can make this explanation as addition info onto official documentation. There are more artists working on exterior project probably need this info as well :slight_smile:

I think the shadow frustum demonstration is mentioned somewhere in the documentation, but I’m not sure about the Cascaded Shadow Maps. Typically things that are a little more involved like that are not mentioned, but it’s something I would like to see go into more detail as well. Hopefully we can get some more detailed information into the documentation in the future.