Version: Unity 6.5 Alpha (6000.5)
Language : English
HDR emulation scale
Create 2D lit shader with Shader Graph

Create shadows with Shadow Caster 2D in URP

Learn how the Shadow Caster 2D component defines the shape and properties that a light uses to determine its cast shadows.

Add the Shadow Caster 2D component to a GameObject by going to Component > Rendering > 2D > Shadow Caster 2D.

Left: Use Renderer Silhouette disabled, Self Shadow disabled. Right: Use Renderer Silhouette enabled, Self Shadow disabled.
Left: Use Renderer Silhouette disabled, Self Shadow disabled. Right: Use Renderer Silhouette enabled, Self Shadow disabled.
Left: Use Renderer Silhouette disabled, Self Shadows enabled. Right: Use Renderer Silhouette enabled, Self Shadows enabled.
Left: Use Renderer Silhouette disabled, Self Shadows enabled. Right: Use Renderer Silhouette enabled, Self Shadows enabled.
Property Description
Casting Source Sets the source for the shape of the shadows. The options are the following:
  • Shape Editor: Uses the shape defined in the Shadow Caster 2D’s Shape Editor.
  • None: Disables shadow casting.
The default is Shape Editor.
Casting Option Sets how the GameObject casts shadows. The options are the following:
  • Self Shadow: Casts shadows from itself.
  • Cast Shadow: Casts shadows onto other objects.
  • Cast and Self Shadow: Casts shadows from itself and onto other objects.
  • None: Casts no shadows.
The default is Cast Shadow.
Target Sorting Layers Applies the shadows to these sorting layers. The options are the following:
  • Nothing: Applies no shadows to any sorting layers.
  • Everything: Applies shadows to all sorting layers.
The default is Everything.

Composite Shadow Caster 2D

The Composite Shadow Caster 2D component merges the shape of multiple Shadow Caster 2D components together as a single shadow caster 2D.

To use a Composite Shadow Caster 2D component, do the following:

  1. To add a Composite Shadow Caster 2D component to a GameObject, go to Component > Rendering > 2D > Composite Shadow Caster 2D.

  2. Add GameObjects with the Shadow Caster 2D component as children of the GameObjectThe fundamental object in Unity scenes, which can represent characters, props, scenery, cameras, waypoints, and more. A GameObject’s functionality is defined by the Components attached to it. More info
    See in Glossary
    from step 1.

The Composite Shadow Caster 2D component merges all Shadow Caster 2D components within this hierarchy, including any Shadow Caster 2D components on the parent.

Left: Without Composite Shadow Caster 2D. Right: With Composite Shadow Caster 2D
Left: Without Composite Shadow Caster 2D. Right: With Composite Shadow Caster 2D
HDR emulation scale
Create 2D lit shader with Shader Graph