Inverted Normal Studio

Sharp Stencil Shadows

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

Installation

Home › Getting Started

Requirements

  • Unity 6 (6.0 through 6.6) with its URP. See Compatibility for tested versions.
  • An active URP asset using Universal Renderers. The 2D Renderer is not supported.
  • A stencil-capable camera depth format, which is URP's default.

No extra packages are needed. Burst, Collections, and Mathematics install with URP. The GPU backend uses compute shaders where available and otherwise falls back to the CPU automatically.

Importing the asset

Import from Package Manager > My Assets. Everything goes into Assets/SharpStencilShadows. Importing does not change your project's URP settings.

Folder Contents Required
Runtime, Editor, Shaders, Generated The feature, its tools, shaders, and topology cache Yes
Settings Sample URP pipeline assets No
Demo, Showcase Demo scenes No
Documentation An offline copy of this documentation No

Installing the renderer feature

The welcome window opens after import and at Editor startup. You can reopen it from Tools > Sharp Stencil Shadows > Open Welcome Screen, or turn it off with Open on startup.

  1. Click Install Renderer Feature.
  2. Select the renderers to install on. All of the active URP asset's Universal Renderers are selected by default.
  3. Leave Turn off directional light shadow maps in open scenes checked unless you set Shadow Types yourself. It sets each directional light's Shadow Type to No Shadows, so URP's shadow map isn't drawn under the stencil shadow.
  4. Click Install selected and confirm.
  5. Save your scenes to keep the light changes. Edit > Undo reverts them.

URP's shadow settings on the URP asset stay on, because URP Lighting uses them. For scenes you open later, set the directional light's Shadow Type to No Shadows yourself. See Lights.

Running the installer again refreshes the feature and keeps its settings. It only affects the active URP asset. To install on another quality level's asset, make that level active and install again.

URP Lighting mode: URP Lighting needs URP's Screen Space Shadows renderer feature on the same renderer. When you switch a feature to URP Lighting on a renderer without one, the inspector asks whether to add it. Click Yes to add Screen Space Shadows (Sharp Stencil Shadows). If you click No, the inspector shows a warning with an Add Screen Space Shadows button, and the renderer draws Overlay shadows until you add it. The installer also adds the feature, and removes it again after you switch back to Overlay.

Adding by hand: you can add Sharp Stencil Shadows from Add Renderer Feature, but run the installer afterwards to assign its shader references.

What the installer changes

  • Adds or refreshes the Sharp Stencil Shadows feature on each selected renderer asset, with its shader references.
  • Adds or removes its own Screen Space Shadows feature to match the lighting mode.
  • Creates the topology cache in Generated/Resources if missing.
  • If the shadow map option is checked, sets Shadow Type to No Shadows on directional lights in the open scenes. It doesn't save the scenes.

It does not change your active URP asset, Graphics or Quality settings, other renderer features, other lights, or materials.

Updating

Import the new version over the old one, then click Install Renderer Feature again. If you use the sample pipeline assets, also click Repair bundled sample renderers. Check the Release Notes for version-specific steps.

Uninstalling

  1. Remove Sharp Stencil Shadows and Screen Space Shadows (Sharp Stencil Shadows) from your renderer assets.
  2. Switch any Sharp Stencil Shadows/Lit materials back to Universal Render Pipeline/Lit. Their settings carry over.
  3. If you used the demo preset buttons, reassign your own URP asset in Project Settings > Quality.
  4. Delete Assets/SharpStencilShadows.

Removing the features first avoids missing-feature references in your renderer assets.