Version: Unity 6.6 Alpha (6000.6)
Language : English
Prepare and upgrade sprites for 2D lighting in URP
Configure a 2D light in URP

Create a 2D light in URP

Create a 2D light in the Universal Render PipelineA series of operations that take the contents of a Scene, and displays them on a screen. Unity lets you choose from pre-built render pipelines, or write your own. More info
See in Glossary
(URP). 2D lights illuminate compatible 2D GameObjectsThe 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
in your sceneA Scene contains the environments and menus of your game. Think of each unique Scene file as a unique level. In each Scene, you place your environments, obstacles, and decorations, essentially designing and building your game in pieces. More info
See in Glossary
.

Follow these steps:

  1. Right-click in the Hierarchy window, then select Light.

  2. Select one of the built-in 2D light types. The types are:

    • Spot Light 2D: Emits light from a point in a specific direction with a cone-shaped area of effect.
    • SpriteA 2D graphic objects. If you are used to working in 3D, Sprites are essentially just standard textures but there are special techniques for combining and managing sprite textures for efficiency and convenience during development. More info
      See in Glossary
      Light 2D
      : Emits light in the shape of a sprite.
    • Freeform Light 2D: Emits light as a custom polygon shape that you can edit.
    • Global Light 2D: Lights all 2D GameObjects equally with no attenuation. You can only use one global light per blend style and sorting layer.

If you create a custom 2D light type, the custom light type also appears in the list.

Left: A Spot Light 2D in the Editor window. Right: The resulting light effect. The sprite is lit from one direction.
Left: A Spot Light 2D in the Editor window. Right: The resulting light effect. The sprite is lit from one direction.
Left: A Sprite Light 2D in the Editor window. Right: The resulting light effect. The sprite is lit in the shape of the selected sprite.
Left: A Sprite Light 2D in the Editor window. Right: The resulting light effect. The sprite is lit in the shape of the selected sprite.
Left: A Freeform Light 2D in the Editor window. Right: The resulting light effect. The object is lit by the polygon shape of the Freeform Light.
Left: A Freeform Light 2D in the Editor window. Right: The resulting light effect. The object is lit by the polygon shape of the Freeform Light.

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.
Left: Outline self-intersection in Edit mode. Right: Light effect with a black triangular artifact.

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

Prepare and upgrade sprites for 2D lighting in URP
Configure a 2D light in URP