Inverted Normal Studio

Sharp Stencil Shadows

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

URP and Project Settings

Home › Reference

URP pipeline asset

Setting Requirement
Lighting > Main Light > Cast Shadows On, for main light shadows in either lighting mode.
Lighting > Additional Lights Per Pixel with Cast Shadows on, for point and spot light shadows. Otherwise URP strips their shader variants from players.
Shadows > Max Distance Stencil shadows render up to this view depth, as URP's own shadows do.
Rendering > Depth Texture Not required. The feature requests scene depth when it needs it (fog, Textured mode).
Quality > Render Scale Any value.
Quality > Anti Aliasing (MSAA) Tested at 1x, 2x, 4x, and 8x.

Universal Renderer

Setting Requirement
Rendering Path Forward, Forward+, Deferred, or Deferred+. See Rendering paths.
Depth Attachment Format Must include stencil. The default does.
Tile-Only Mode Off. When on, URP Lighting falls back to Overlay, Textured to Uniform Opacity, and shadows are unfogged.
Transparent Receive Shadows On (default) for point and spot light shadows on classic Deferred.
Screen Space Shadows feature Needed on URP Lighting renderers. The installer adds it, or the feature's inspector when you switch to URP Lighting.

Lights

  • Set Shadow Type to No Shadows on lights with stencil shadows. On classic Deferred, point and spot lights that should shadow G-buffer materials need Hard or Soft. See Classic Deferred renderers.
  • Point and spot lights must be Realtime or Mixed, on a layer in Light Layers.

Quality levels

Each quality level can use its own URP asset. Install the renderer feature on each one: make the level active in Project Settings > Quality, then run the installer. The welcome window's demo preset buttons replace the current level's URP asset.

Player builds

Shader variant stripping

URP strips shadow shader variants its settings don't use. For URP Lighting in players:

  • Renderers must be saved in URP Lighting mode with the installer's Screen Space Shadows feature. A renderer without it renders Overlay shadows when switched to URP Lighting at runtime, with one warning.
  • The URP asset must have Main Light > Cast Shadows on, and support additional light shadows, as above.

Build preprocessing

Before each player build, the feature:

  • updates the topology cache for non-readable meshes
  • warns about URP Lighting renderers missing the Screen Space Shadows feature, and URP assets without additional light shadows