Analytic Soft Shadows (Built-In/URP)

Analytic Soft Shadows is a real-time soft shadowing solution with shadows defined by Spheres, Capsules and Boxes.


Forum ThreadDemo • ✅ Built-In (2022+/6+) • ✅ URP (2022+/6+)


Big 6 Update: Unity 6 is now natively supported and optimized for!


It has bothered me for a long time how unrealistically sharp shadow maps are, even with tricks like percentage closest filtering, they just don't get soft enough to feel realistic. I came across the Analytic Shadows technique and knew I had to implement it in Unity.


Features

Insane Performance: Due to tiled-culling and depth-aware-upsampling in a lot of cases the performance can be better than Unity's shadowmapping! (Best case: Approximating high-poly models with few soft shadow shapes. Medium case: Approximating models with hundreds of small soft shadow shapes.)

New feature! Colored Shadows: Each shadowcaster can now cast a unique shadow color instead of black. Example.

• Famous Capsule Shadows algorithm used in many AAA games (TLoU2, CS2, Warframe).

• Real-time adjustable shadow softness all the way from super hard to super soft.

• An additional algorithm option that provides soft shadows that do not fade with distance, if that's what you want, similar to "Signed Distance Field shadows".

• Blends with Unity's shadows nicely so you can mix and match them interchangeably.

• Practically infinite shadow resolution, zoom in as close and as far away as you like.

• Full source code included for maximum configurability.


Limitations

• Built-in: Deferred rendering path only, URP: Forward rendering path only.

• Mobile, WebGL not officially supported. A platform with compute shader support is required.


Enjoy!