Sharp Shadows Toolkit
The Sharp Shadows Toolkit is a code package that brings sharp, pixel-perfect shadows to your Lightweight/Universal Render Pipeline project. Many games and experiences target a non-photo-realistic art style for which sharp shadows are better suited than the built-in shadows that tend to be either too soft or too jagged, especially on low quality settings.
The toolkit can be useful in a wide variety of scenarios, from a single accurate drop-shadow for the main character in a mobile game to ubiquitous high quality shadows for an architecture visualization project.
Bug in v1.1, fix as v1.1.1 waiting Asset Store approval Unfortunately, a last minute bug creeped into the v1.1 release and there is a compile error in SharpShadowManager if SHARP_SHADOWS_DEBUG is not defined (which is the case for all setups except mine). To work around the issue, open up
SharpShadowManager.cs
and movenamespace SharpShadowsToolkit {
to above the#if
line, like this:
Features
- Dynamic pixel-perfect shadows for the Lightweight/Universal Render Pipeline
- No jagged shadow edges or visible pixels
- Seamless editor integration using automatic asset post processing
- Two rendering modes
Inject Into Screen Space Shadow Resolve Texture
: Inject into screen space shadow texture for optimal image qualityMultiply Scene After Opaque
: Draw after opaque geometry for optimal performance
- Handles both skinned and non-skinned meshes
- No restriction on the mesh geometry of the shadow caster
- Multi-object editing
- Fog support
Current Limitations
- For the Lightweight/Universal Render Pipeline only
- Only supports the main directional light of the scene
- No support for custom vertex displacement
- Alpha blended or clipped geometry will produce solid shadows (the shape of the triangles)
- Skinned mesh shadows may appear cracked if they are subject to large deformations
- Shadows are not anti-aliased when injected into screen space shadow texture
Supported Unity builds
Unity version | Build tested | LWRP/URP version |
---|---|---|
Unity 2019.1 | 2019.1.10f1 | 5.7.2 |
Unity 2019.2 | 2019.2.3f1 | 6.9.1 |
Unity 2019.3 | 2019.3.0b2, 2019.3.5f1 | 7.0.1, 7.1.8 |
Unity 2021.1 | 2021.1.11f1 | 11.0.0 |
Important note on URP 7.2-10.5: Unity changed the way shadows are handled between URP 7.2 and 10.5 and as a result, the most natural shadow mode (“Inject Into Screen Space Shadow Resolve Texture”) is not available in these versions. Supported versions are stated above. Starting with Unity 2021 and URP 11, the toolkit is again feature complete!