At Distance 4000, I get the best results, but only if the camera is very close.
I want to have detailed shadows with a further distance of the camera.
With Values lower or higher than 4000, the shadows are ALWAYS undetailed.
I’d like to have a proper explanation how to setup the shadow maps so I have Detail 1 until Distance X, Detail 2 until Distance Y and so on.
r.Shadow.MaxResolution and Shadow Filter Sharpen are the value you can tweak, but getting masked grass, like the one you have, to cast detailed shadow comes at very high performance cost.
Well. I’d like to have “super detailed” shadows until Distance X, “not so detailed Shadows” until Distance Y and “horrible Shadows” at Distance Z.
There is only one shadow map that is being used. I think it is 1536 x 1536 or something by default on highest settings. That one texture is then split into different parts, called cascades. First cascade is the one that is closest to the view, thus it gets the largest portion of that one 1536 x 1536 shadow map. Next cascade starts from where the first ends and it goes on further. That second cascade will have a smaller split of the 1536 x 1536 texture. This splitting happens as many cascades you have specified.
The distribution exponent specifies the ratio between sizes between the shadow cascades. I guess having an exponent of 1 means that each cascade is equally large, which isn’t optimal since you need higher resolution up front.
Also to second on that, if lets say the first fraction that has the “in theory” highest quality that looks nice and crisp over 250 units gets spread over 800 units instead, it will still use the same resolution to cover a larger area thus meaning a decrease in quality! The only way to work against this is increasing cascaded shadow map resolution via console variables.
So just increasing the distances will not make the shadows look better, it will blur them even more if you dont compensate with higher resolution
Well the resolution can be as low or as high as you want it to be.
Try the console command r.Shadow.MaxResolution 4096
It’s worth mentioning that increasing the Dynamic Shadow Resolution can have a HUGE impact on performance.
So it’s probably a good idea to have it as a setting in your game options menu, where 4096 could be very high, ultra or whatever.
I see I haven’t understand the Cascaded Shadow Maps.
Can you give me some kind of visualization? I need an explanation about the meaning of resolution and distance here…
I’d try setting the Editor scalability settings for Shadows to “High” or “Epic” before experimenting with cascaded shadow maps, as they seem to crippled on the lower settings by default.
You need to understand that the resolution of the shadow map will stay the same regardless of the settings you set for the light shadow settings. If you increase the distance you’re effectively stretching the shadow map, which in turn causes low res shadows.
Cascaded shadow maps just split that single shadow map into different parts and those parts can be made larger or smaller depending on your settings. It basically allows you to trade resolution between far and near cascades. Far away stuff doesn’t require much resolution since you can’t see it anyway, so it’s better to use that resolution close to the camera.
This is a general idea behind the Cascaded Shadow Maps:
To have a really good resolution in front of the camera you need more cascades or higher resolution or shorter range that they cover. You could try all three, don’t remember if amount of cascades is capped.
Well, I just want to throw my two cents in here as I’ve been studying UE4’s lighting extensively for almost two years now. Regarding cascaded shadows, UE4 behaves a little strangely under particular circumstances:
Movable directional might tend to have significantly sharper results than Stationary. Not entirely sure why, but it’s a symptom that also exists with spotlight and point light dynamic shadows as well.
You can have more than four cascades, but weird artifacts may begin to appear, such as shadows cutting off at a shorter distance, or not rendering at all.
Now, you’re not going to want to get a sharp shadow for grass strictly from shadow cascades because you will murder your performance. I’m also going to assume you’re not using Ray-Tracing. Thankfully, that’s what contact shadows are for, and if you aren’t sure, it’s a parameter in the directional light settings, and the difference can be striking. I typically set the value between 0.01-0.03.