keywords:UE4、Shadows、Scene Optimization、阴影、场景优化

Enable Dynamic Shadow Distance

Test 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.

How to Cast Shadow by Camera Distance

Tow factors

  • RayTraced Distance Field Soft Shadows
  • Scalability of Shadow
RayTraced Distance Field Soft Shadows
  1. Project Settings -> Engine -> Rendering -> Lighting -> enable Generate Mesh Distance Fields (Need to restart Editor)

  2. Modify DirectionalLight’s properties: DistanceField Shadow Distance and RayTraced DistanceField Shadows

    Effect

Relationship between DistanceField Shadow Distance & Dynamic Shadow Distance
  • Stationary

  • Moveable

Reference:RayTraced Distance Field Soft Shadows
https://docs.unrealengine.com/en-us/Engine/Rendering/LightingAndShadows/RayTracedDistanceFieldShadowing

Scalability of Shadow
  • Cinematic

  • Medium

  • Low

Scalability Reference
https://docs.unrealengine.com/en-US/engine/performance/scalability/scalabilityreference

Reference

Dynamic Scene Shadows
https://docs.unrealengine.com/en-us/Resources/ContentExamples/DynamicSceneShadows

Cascaded Shadows
https://docs.unrealengine.com/en-us/Platforms/Mobile/Lighting/HowTo/CascadedShadow

RayTraced Distance Field Soft Shadows
https://docs.unrealengine.com/en-us/Engine/Rendering/LightingAndShadows/RayTracedDistanceFieldShadowing

Shadow Casting
https://docs.unrealengine.com/en-us/Engine/Rendering/LightingAndShadows/Shadows


人会长大三次。第一次是在发现自己不是世界中心的时候。第二次是在发现即使再怎么努力,终究还是有些事令人无能为力的时候。第三次是在,明知道有些事可能会无能为力,但还是会尽力争取的时候。