Lights and Lighting Modes
Home › Guides
Supported lights at a glance
| Light | Overlay | URP Lighting |
|---|---|---|
| Main directional light | Yes | Yes |
| Point and spot lights | No | Up to 7 per camera |
| Other directional lights | No | No |
| Area lights | No | No |
Lighting modes
Set per renderer with General > Lighting Mode.
Overlay
The default. After opaques, shadowed pixels are blended toward Shadow Color by Shadow Strength. Shadows darken everything on the pixel, including ambient light and other lights. It is the cheapest mode and works with any opaque material.
URP Lighting
Shadows are fed into URP's own shadow inputs before opaques, so a shadow removes only its own light's direct contribution. Ambient, sky, reflections, and other lights stay. Shadow Strength sets how much of the light a shadow removes, and Shadow Color is unused. The URP asset needs Main Light > Cast Shadows on.
It works with URP Lit, Simple Lit, Complex Lit, and Shader Graph lit materials. It costs more than Overlay: a depth prepass, a screen-sized depth-stencil copy, one screen-sized RGBA8 texture per four lights (8 MB each at 1080p), and a point and spot light shadow atlas.
Choosing and switching modes
Use Overlay for the lowest cost, mobile, or stylized flat shadows. Use URP Lighting for lighting-correct shadows or point and spot light shadows.
After switching a renderer to URP Lighting in the Inspector, run the installer again. See Installation. To switch at runtime:
StencilShadowRendererFeature.FindActive()?.SetLightingMode(ShadowLightingMode.UrpLighting);
A renderer without URP's Screen Space Shadows feature renders Overlay shadows when switched to URP Lighting, with one warning. Save renderers in the mode players will use.
Automatic fallback to Overlay
URP Lighting needs scene depth and the renderer's Screen Space Shadows feature. A camera whose renderer cannot provide scene depth, such as one in Tile-Only Mode, or has no active Screen Space Shadows feature, renders Overlay instead, with one diagnostic.
Main directional light
Stencil shadows use URP's main light: the Sun Source set in the Lighting window, or otherwise the brightest directional light. Set its Shadow Type to No Shadows. In Overlay, URP's shadow would otherwise darken the same area twice. In URP Lighting, it would be computed and discarded.
Point and spot lights
Point and spot light shadows need URP Lighting mode, and a URP asset with Additional Lights set to Per Pixel and Cast Shadows enabled.
Which lights get shadows
A point or spot light is eligible when it is Realtime or Mixed, has a positive range, and is on a layer in Point & Spot Lights > Light Layers. Each camera shadows the eligible lights nearest to it, measured to the edge of their range, up to Max Shadowed Lights (0 to 7, default 4).
Each light only processes casters within its range or cone, its stencil work is limited to its screen area, and its volumes end at twice its range. Static lights and casters cost no volume regeneration.
Shadow Type
Set Shadow Type to No Shadows on lights the feature shadows. In URP Lighting mode, the feature takes over every point and spot light's realtime shadow, so point and spot lights outside the budget have no realtime shadow. Classic Deferred renderers are the exception.
Classic Deferred renderers
On a classic Deferred renderer, with Transparent Receive Shadows on (the default):
- Forward-only receivers, such as Sharp Stencil Shadows/Lit and Complex Lit, get stencil shadows from every shadowed point and spot light.
- G-buffer receivers, such as URP Lit, get a point or spot light's stencil shadow only if that light's Shadow Type is Hard or Soft. URP then also renders its own shadow map for that light, which the stencil shadow replaces.
Prefer Deferred+ when many point and spot lights need shadows. See Compatibility.
Light type limitations
- Other directional lights: only the main light casts stencil shadows.
- Area and baked lights: area lights are baked-only in URP, and Baked point and spot lights are excluded.
- Point and spot lights in Overlay: not shadowed. They can keep URP's own shadow maps.
- Per-vertex additional lights: receive no point or spot stencil shadows.
- Soft shadows: not supported. All stencil shadows are hard.
- Light budget: at most 7 point and spot lights per camera. If their shadow atlas tiles do not fit the maximum texture size, the farthest lights drop out, with one diagnostic.