Inverted Normal Studio

Sharp Stencil Shadows

Documentation for Sharp Stencil Shadows, a URP renderer feature for hard, pixel-exact stencil shadow volumes.

Introduction

Home › Overview

Sharp Stencil Shadows is a URP renderer feature that renders hard, pixel-exact shadows using stencil shadow volumes. It uses a component-less design, with automatic volume generation for Mesh Renderers and Skinned Mesh Renderers.

It suits projects that want crisp, stable shadow edges: stylized, retro, pixel-art, mobile games, top-down and orthographic cameras, and scenes that need sharp shadows no matter the camera proximity.

Key features

  • Pixel-sharp at any distance. No shadow map resolution or cascades. Shadows reach as far as URP's Max Distance.\*
  • Component-free casters. Mesh and skinned renderers are discovered by layer.
  • Directional, point, and spot lights. Up to seven point and spot lights per camera.
  • Two lighting modes. Overlay composites shadows over the image. URP Lighting feeds them into URP's own lighting, so a shadow removes only its light's contribution.
  • Animated and deformed casters. Skinned meshes and compute-deformed meshes cast their current shape.
  • Cutout and glass casters. Alpha-clipped casters cast holes, and transparent casters cast partial, colored shadows.
  • CPU and GPU generation. Burst jobs or batched GPU compute, with automatic per-caster fallback.
  • Supports All Universal Render Paths. Forward, Forward+, Deferred, and Deferred+.
  • Supports Several Graphics APIs. DX12, DX11, Vulkan, and OpenGL ES on Android.

\* Alpha-clipped and transparent casters in Textured mode are drawn into a light-space caster atlas, so their shadow detail depends on the atlas resolution. See Transparent and Translucent Casters.

Stencil shadows vs. shadow maps

Stencil shadows Shadow maps
Edge quality Exact per screen pixel, at any distance Limited by map resolution and cascades
Soft shadows No Yes
Cost grows with Caster geometry and on-screen volume area Map resolution and caster count

In Overlay mode, only the main light uses stencil shadows, so point and spot lights can keep URP shadow maps. In URP Lighting mode, stencil shadows replace URP's realtime shadows, so point and spot lights without stencil shadows have none, except on classic Deferred. In both modes, set the main light's Shadow Type to No Shadows to avoid double shadows.

See Known Limitations for what is not supported.

Next steps