keywords:UE4, Shadow Optimization, Scene Optimization, 阴影, 场景, 优化

The latest article: UE5 Shadow Notes

Shadow Optimization

Enable Dynamic Shadow Distance

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.

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


Relationship between DistanceField Shadow Distance & Dynamic Shadow Distance
  • Stationary

  • Moveable

Reference:RayTraced Distance Field Soft Shadows

Scalability of Shadow
  • Cinematic

  • Medium

  • Low

Scalability Reference

Cast shadow by level of detail (LOD)

Console command:

//LOD level to force for the shadow map generation only, -1 is off.

It works only for non-dynamic lights.

ShadowMap Memory Size

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

The higher the shadow quality, the larger the light map resolution, and the larger the memory cost of shadow map .

How to cast character shadow on mobile device

1st way: Movable Directional Light

How to Enable Dynamic Shadows & Correct Reflection Maps on Mobile

Lighting for Mobile Platforms

4.7 release mobile shadows

2nd way: Stationary Directional Light

Enable Cast Modulated Shadows:

Casting Shadow (Common questions)

How to Cast Shadow for SkeletalMesh


UPrimitiveComponent->CastShadow = true;



UPrimitiveComponent->CastShadow = true; would not work out of Constructor.

How to cast shadow when Actor hidden in game
USkeletalMeshComponent->bCastHiddenShadow = true;
How to prevent mesh from receiving shadows

Set material’s Shading Model to Unlit, then set you base color to go to the emissive(so its not totally black), but Matellic and Specular lost.




Dynamic Scene Shadows

Cascaded Shadows

RayTraced Distance Field Soft Shadows

Shadow Casting

Unreal Engine 4 的 光和影

[UE4] Introduction to Shadow Rendering function

Shadow Casting: High level overview of shadows. (Recommended)

Fake Dynamic Lighting

Using modulate blend material to make a light

How to Create Blob Shadows in Unreal Engine 4 (Part 1)

Capsule Shadows

Capsule Shadows