
Lighting for 2D projects
Tutorial
Beginner
+0XP
15 mins
Unity Technologies
This tutorial guides you through applying your 3D lighting knowledge to 2D Unity projects.
1. Overview
You’ve made lighting for 3D projects, including configuring Directional Lights and skyboxes, adding various Point Lights and Spot Lights, configuring shadows, using Light probes and Reflection probes, and creating emissive materials.
In this tutorial, you’ll explore a 2D scene with similar functionality, and learn how implementing those features would be the same or different.

2. Experience the 2D_Lighting scene
In this step, you'll open the CreativeCore_2D project and then explore the 2D Lighting demo scene within it.
Instructions
To test out and explore the 2D Lighting scene, follow these instructions:
1. Download and open the CreativeCore_2D project:
- If you’ve already downloaded the CreativeCore_2D project in a previous unit, open it now using the Unity Hub.
- If you haven’t downloaded it yet, you can download the project here and then open it using the Unity Hub.
- When the project is open in the Unity Editor, verify you see a CreativeCore_2D folder within your Project window, containing several subfolders.
2. Open the CC_Lighting_2D scene:
- Go to Assets > CreativeCore_2D > Scenes, then open CC_Lighting_2D_Scene.
3. Enter Play mode and take note of the Lighting elements:
- Enter Play mode.
- Notice the following:
- Dynamic lighting that affects moving objects in the scene.
- Multiple types, shapes, and colors of light sources.
- Shadows cast by the player robot.
- Emissive lighting
- Exit Play mode when you are done.
3. Explore the 2D vs 3D implementation
When implementing lighting in Unity 2D projects, you'll find both similarities and key differences compared to 3D projects.
For each of the similarities and differences listed below, explore the project to make sure you understand how each of the features were implemented in 2D.
What's the same?
Global and local lighting:
In 3D, a Directional Light provides broad scene illumination, while Point, Spot, and Area Lights affect localized regions. In just the same way, in 2D, a Global Light 2D can set uniform, scene-wide illumination, while localized Light 2D types (Spot, Freeform, and Sprite) are placed to light specific areas.
1. In the Hierarchy window, use the fallout (triangle) to expand the Lighting GameObject, then select the Global Light 2D child GameObject.
2. In the Light 2D component, open the Light Type property dropdown and browse the different light types available.
3. For the Global Light 2D GameObject, adjust the Intensity and Color properties to see the effect these properties have on the overall scene, similar to a Directional Light in a 3D scene.

What's different?
Unlit vs Lit shaders:
Lighting in 2D projects is not as common or universally necessary as in 3D projects; it often serves a specific artistic style. Since many 2D projects don’t require lighting, they would use an unlit shader. A sprite with an unlit shader will appear the same brightness regardless of lighting conditions. You need to use a lit shader (such as Sprite-Lit-Default) for lighting to even work.
1. Select the Ground GameObject, and in its Sprite Renderer component, set the Material property to Sprite-Unlit-Default.
2. Try this with other sprites to see the huge impact lighting has on the sprites in this scene.

Light 2D component:
There’s a specific Light 2D component that’s distinct from the 3D Light component. The Light 2D component is designed for 2D lighting calculations.
1. Select any GameObject, and at the bottom of the Inspector window, select Add Component, and search for “Light”.
2. Notice how there’s a Light 2D component, distinct from the normal 3D Light component.

Different light types:
3D projects primarily use Directional, Point, Spot, and Area lights. 2D projects use Global, Spot, Sprite, and Freeform Light 2D types. You can learn more about each of these in Unity's 2D lighting documentation.
1. In the Hierarchy window, use the foldout (triangle) to expand the Lighting GameObject.
2. Select one of the 2D Lights shining along the art along the back wall — these are all Spot lights.
3. In the Light 2D Component, experiment with the following properties:
- Radius
- Inner / Outer Spot Angle
- Falloff Strength
You’ll see that these values allow you to make your 2D lights behave like Point lights or Spot lights you used in the 3D scene.
4. Select the Light 2D_Fruit, which is a Freeform light. Select Edit Shape to configure the shape of the light in the Scene view.

Normal maps disabled by default in lights
While normal maps in 3D appear by default with standard lights, 2D Lights have normal maps disabled by default. You need to change the Quality property from Disabled to either Fast or Accurate within the Light 2D component for normal maps to render.
1. In the Hierarchy window, select the Light 2D_Trophy GameObject.
2. In the Light 2D component, in the Normal Maps section, open the Quality dropdown and explore the options.
The Quality property is set Disabled by default, but you must use either Fast or Accurate for normal maps to render under a 2D light.
3. Try temporarily setting this property to Disabled to see the impact of not having normal maps enabled for the trophy.

Shadows
In 3D, objects cast shadows by default if lights are configured correctly. In 2D projects, objects don’t cast a shadow by default. To enable shadows in 2D, you need to add a Shadow Caster 2D component to your GameObjects and then configure the component’s properties to your liking.
1. Select the PlayerRobot GameObject, then locate the Shadow Caster 2D component.
2. Try disabling and enabling this component to see the impact it has on the scene.

No baked lighting:
In 3D, lighting is computationally intensive because of complex geometry, shadows, reflections, and material interactions on 3D surfaces. When you bake lights in 3D scenes, lighting information is precomputed into lightmap textures, which dramatically improves performance with static lighting.
In 2D, rendering is simpler and sprite-based, without complex 3D light interactions. 2D lighting works primarily through sprite color/alpha adjustments. There wouldn’t be as much of a benefit to 3D-style baking in 2D, since real-time 2D lighting is already relatively efficient.

No Light probes or Reflection probes:
Similar to the concept of baked lighting, in 2D, the detailed capture of indirect light and reflections is not as applicable, therefore these probes don’t make as much sense in a 2D context.

4. Next steps
You now understand how to implement lighting in 3D projects and how that translates to, or differs from, 2D projects. You’re ready to apply these concepts to your own personal projects, be they 3D or 2D.