Testing Case: 500 Actors are rendering in screen, Camera height is 4000, DirectionalLight’s property Dynamic Shadow Distance StationaryLight (Default value is 0, which means disabled) should be larger than the straight-line distance from Camera to Actor (Beacause the distance need to cover all Actors, so the distance would be better be larger ), otherwise frame rate would drop down from 200 fps to 100 fps.
Testing case:
Place 1024 cubes in an empty level, casting shadow by stationary DirectionalLight, and check the memory cost of shadow map. (console cmd:stat rhi)
Shadows quality: Low
Shadows quality: Cinematic
Conclusion:
The higher the shadow quality, the larger the memory cost of shadow map.
Another factor affected the memory cost for shadow computing is the light map resolution:
The larger the light map resolution, and higher of texture atlas res which packed and stored for light map and shadow map is.
Sample of texture atlas:
What’s the difference between light map and shadow map?
Light map (created by Lightmass) is used to precompute indirect lighting (diffuse interreflection, e.g. Global Illumination) of lights with stationary and static mobility, while shadow map is ued to store surface’s depth value of geometry, these surface were shooted by direct lighting (stationary light or movable light).
Shadow Optimization for Foliage
Contact Shadow is screen space, distance of the shadow has no difference in performance. It’s used in combination with other shadow methods for cheap extra detail.
Add a new light with independent light channel (e.g. Channel 2), then enable the Channel 2 on the target mesh, thus this new light will illuminate the dark surface on the target mesh, and will not affect other meshes.
See: How to use Light Channels