Home / Blog / Unreal Engine Optimization – Capsule Shadows

Unreal Engine Optimization – Capsule Shadows

Unreal Engine’s Capsule Shadows feature provides a lightweight, high-quality dynamic approximation of shadowing for skeletal meshes, enabling a performant alternative to regular shadows. 

What Are Capsule Shadows? 

Capsule Shadows approximate the character’s shape with a set of primitive capsules aligned to each limb (thigh, shin, torso, etc.). Unreal Engine then grabs those capsules and projects their combined occlusion into the scene. 

Key Benefits 

Performance: by reducing shadow‐casting geometry to a handful of capsules, the engine performs far fewer operations, freeing GPU time for other processing.

Soft shape: Capsule Shadows work best with soft shadowing, and UE provides multiple parameters for the best result.

Dynamic Consistency: since capsules follow skeletal animations, shadows remain stable and reliable, eliminating shimmering or pop-in.

How To Enable 

1. Create physics asset and auto snap capsules to skeletal mesh: In skeletal mesh actions, choose: Create -> Physics Asset -> Create. 

2. Tweak parameters to your liking in the newly shown window, and press Create Asset. 

3. Open the skeletal mesh asset and assign the created physics asset in Asset Details to Lighting -> Shadow Physics Asset. 

4. On the skeletal mesh instance, enable Capsule Direct Shadow flag (for dynamic lighting) and/or Capsule Indirect Shadow flag (for lightmaps or skylight). 

5. For indirect shadows, also tweak the Capsule Indirect Shadow Min Visibility parameter. 

Once this is done for all required characters, it is worth configuring visual parameters with the help of console commands:

  • r.CapsuleSkyAngleScale – to configure softness, try values around 0.1 
  • r.CapsuleMaxIndirectOcclusionDistance – to set indirect shadow length, for a regular human-sized character, try values around 200-400 
  • r.CapsuleMaxDirectOcclusionDistance – same for direct shadow length 

When to Use 

Environments with numerous characters: such scenes can benefit substantially as each actor’s shadow cost scales down. 

Mobile and console targets: platforms with hardware limitations will benefit from more consistent performance by reducing shadow complexity. 

Baked lighting: since baked lightmaps don’t provide dynamic shadowing, Capsule Shadows can be a reasonable addition. 

Always remember to analyze the performance boost before delivering the solution; the stat GPU command provides a separate Capsule Shadows category to help with comparison. 

Here’s an example of indirect capsule shadow:

………………………………………………………..

 

Useful links:

Author

Sergey Bieliayev

Lead Software Engineer

Seasoned engineer with 14 years of expertise in game development, porting, graphics software, and technical leadership. Currently leading PixelAnt Games’ porting/3rd-party division (CollabCrew), he specializes in project evaluation and estimation, architecture design and prototyping, as well as hands-on development for challenging projects. Throughout his career, he has successfully contributed to titles such as Dying Light 2, Chernobylite, Nightingale, Call of Juarez: Gunslinger, Crime Boss: Rockay City, and Trove, among others, across multiple platforms, including PC, Nintendo Switch, Xbox, and PlayStation.

See more posts by this author

Looking for a proven work-for-hire team?

Get in touch to find out how we can support your game!

Hi! We use cookies and similar technologies to better know you and improve your experience with our website.
You can find out more by reading our Privacy Policy.