# Create a 2D light in URP

> Understand the behavior of different Light 2D component properties in greater detail, with examples comparing different effects.

Create a 2D light in the Universal Render Pipeline (URP). 2D lights illuminate compatible 2D GameObjects in your scene.

Follow these steps:

1. Right-click in the **Hierarchy** window, then select **Light**.
2. Select one of the built-in 2D light types.

By default, sprites and tiles you drag into the Editor view use the `Sprite-Lit-Default` shader, which is compatible with 2D lights.

You don't need to move 2D lights forward or backward. 2D lights and shadows affect all GameObjects regardless of the distance between the light and the GameObject.

> **Note:**
>
> 2D materials from the Built-In Render Pipeline don't react to 2D lights. To upgrade materials from the Built-In Render Pipeline to the Universal Render Pipeline, refer to [Migrate from the Built-in Render Pipeline to URP workflow](/engine/6000.3/manual/migrating-from-birp-workflow.md).

If you use the [Scriptable Render Pipeline (SRP) Batcher](/engine/6000.3/manual/analysis/graphics-performance-profiling/in-urp/reduce-draw-calls-urp/srpbatcher/srpbatcher.md), set the **Mode** property of tilemaps to either **Individual** or **SRP Batch** to improve performance. **Chunk** mode is incompatible with the SRP Batcher. For more information about the **Mode** property, refer to [Add 3D height to an isometric tilemap](/engine/6000.3/manual/unity2d/tilemaps/isometric-tilemap/tilemap-renderer-isometric-modes.md).

## Configure which lights affect which GameObjects

By default, a 2D light affects all 2D GameObjects in the scene. To specify which GameObjects a light affects, follow these steps:

1. Assign the GameObjects you want the light to affect to a single sorting layer. For more information, refer to [Sprites sorting order](/engine/6000.3/manual/unity2d/sprite/sort-sprites.md).
2. Select the 2D light in the **Hierarchy** window.
3. In the Editor window, in the **Light 2D** component, set **Target Sorting Layers** to the sorting layer.

When lights affect different sorting layers, performance can decrease because Unity renders more light and shadow textures. For more information, refer to [Optimize 2D lights with batching](/engine/6000.3/manual/unity2d/2d-urp/2d-index/2d-light-batching-debugger.md).

## Add volumetric lighting

All 2D lights can create volumetric light, which is visible light in empty space. Follow these steps:

1. In the **Inspector** window of the 2D light, enable **Volumetric**.
2. Set **Volume Intensity** to a value above zero. The higher the value, the more visible the volumetric light is.

## Avoid self-intersection in Freeform lights

If you create a **Freeform Light 2D**, the light might not appear in areas where the light overlaps with itself.


**Left: Outline self-intersection in Edit mode. Right: Light effect with a black triangular artifact.:**
![](/api/media?file=/engine/6000.3/media/images/2D_FreeformOutlineIntersection-and-effect.png)

To avoid this, do the following:

1. Make sure the edges of the shape don't cross over each other.
2. Set the **Falloff** properties of the light to ensure the light doesn't overlap itself.

## Additional resources

* [Light 2D component reference for URP](/engine/6000.3/manual/unity2d/2d-urp/2d-index/2dlight-properties.md)
* [Creative Core Lighting tutorial in Unity Learn](https://learn.unity.com/project/creative-core-lighting)
