I need maximized shadow quality without LOD, or at least increase LOD distance.
I am using Epic shadows settings + Cast Inset Shadow.
When i fly away from a character (even a small distance), this shadow become unacceptable. Most annoying for me is a Gap between dynamic shadow and feet, when LOD2+. (Self shadow accuracy = 1.0).
How to improve? I need LOD0 shadow for long distance.
(i am using directional light + cast dynamic shadows).
There is a bounds distance that cannot be altered without using C++ or possibly going into the .ini file, but you can offset some settings to help from within the editor. Under the details panel for your light source, in this case your directional light, go to the details panel and look for the “Cascaded Shadow Maps” tab. You’ll find a few settings in here you can slide to tweak to what you may want. The main one is adjusting the Dynamic Shadow Distance. This will affect everything in the scene though, not just your character. Depending on the number of static meshes and whether they cast shadows will greatly impact performance.
While this will increase your shadows they are not crisp and clean. They are going to blur as the distance is increased. You can offset this on the character a little by going into the details panel for the character and under the light tab you’ll find “cast inset shadow”. check this box and that will improve the shadow quality as well.
It seems Directional Light → Cascaded Shadow Maps doesnt have any effect on SkeletalMesh Dynamic Shadows with “Cast Inset Shadow” = true… I think i need to change C++ code for changing Inset Shadows distance quality (or .INI files?). Any ideas where should i start to search?
I found what i was looking for, was tricky from scratch, but good news is that i understand shadow renderring a little better after that.
To turn off “LOD switch” (Resolution switch) for Shadow for Actors (with “Cast Inset Shadow” = True) you have to just to change this:
UE4.1.0 → ShadowSetup.cpp → FDeferredShadingSceneRenderer::CreatePerObjectProjectedShadow:
MaxDesiredResolution = MaxShadowResolution; //[CHANGED] maximized resolution always.
MaxDesiredResolution = FMath::Max(
FMath::Min<int32>(MinShadowResolution,ShadowBufferResolution.X - SHADOW_BORDER * 2),
(fast recompile, only Renderer)
Setting r.Shadow.MinResolution through log console to 1024 is not the same, because FadeOff is not working in that situation.
From this point we can make for example not only Maximized resolution, but also make resolution start to change only from specified Distance by deeper examining FDeferredShadingSceneRenderer::CreatePerObjectProjectedShadow.
Ideally i think there should be Config variable: MaxShadowResolutionDistanceFraction from 0 to 1, which is fraction from DynamicShadowDistance (which is usually 20000.0), so when camera is far than (MaxShadowResolutionDistanceFractionDynamicShadowDistance), then we begin to switch shadow Resolutions between (DynamicShadowDistance - MaxShadowResolutionDistanceFractionDynamicShadowDistance) and (r.Shadow.MaxResolution - r.Shadow.MinResolution).
Now im satisfied with shadows quality.