

Lighting can make or break your game. You can have detailed models and sharp textures, but without good lighting, everything feels flat. On the other hand, even simple scenes can look amazing when lit well.
Unity gives you a flexible lighting system that works for both 2D and 3D projects. In this guide, we’ll walk through the fundamentals of lighting in Unity, the different light types, real-time vs baked lighting, lightmapping, global illumination, and practical tips to make your scenes look better without killing performance.
Lighting does more than just help players see. It sets the mood. It guides attention. It adds depth and realism. A horror scene with soft shadows and limited light feels tense. A bright outdoor scene with warm sunlight feels open and safe.
Before adjusting any settings, ask yourself: what should the player feel in this scene? Your lighting decisions should support that goal.
Unity provides four main light types for 3D projects:
Directional lights simulate distant light sources like the sun. They affect the entire scene equally and don’t weaken over distance. Most outdoor scenes use a directional light as the main light source.
You usually only need one directional light. Rotate it to control the angle of sunlight.
A point light emits light in all directions from a single point, like a light bulb. It has a range value that controls how far the light reaches.
Use point lights for lamps, torches, glowing objects, or explosions.
A spotlight emits light in a cone shape. It’s perfect for flashlights, car headlights, or stage lighting. You can adjust both the range and the spot angle.
Area lights emit light from a rectangular surface. They create soft lighting but only work with baked lighting, not real-time lighting.
One of the most important decisions in Unity lighting is choosing between real-time and baked lighting.
Real-time lighting updates every frame. If an object moves, the lighting updates immediately. This is necessary for dynamic scenes where lights or objects change frequently.
The downside is performance. Real-time lighting is expensive, especially with shadows.
Baked lighting is precomputed and stored in lightmaps. Unity calculates the lighting ahead of time, and during gameplay, it simply reads the result from a texture.
This is much more efficient but only works for static objects.
To bake lighting:
Baked lighting is ideal for indoor environments, architectural scenes, and mobile games.
Mixed lighting combines real-time and baked lighting. For example, static objects receive baked lighting, while dynamic objects use real-time lighting.
This gives you a good balance between quality and performance.
Global Illumination simulates how light bounces off surfaces. Without GI, light only hits objects directly. With GI enabled, light reflects and softly illuminates nearby surfaces.
This adds realism. For example, sunlight hitting a red wall will cast a slight red tint onto nearby objects.
Unity supports both real-time GI (limited and performance-heavy) and baked GI (recommended for most projects).
A lightmap is a texture that stores baked lighting information. Instead of calculating lighting every frame, Unity uses this precomputed texture.
To get good lightmaps:
If shadows look blurry, increase lightmap resolution. If performance drops or memory usage is high, reduce it.
Shadows add depth but can hurt performance.
Each light has shadow settings:
You can control shadow distance in Project Settings → Quality. Reducing shadow distance improves performance, especially in large outdoor scenes.
You can control lights at runtime using scripts. For example, toggling a flashlight on and off:
using UnityEngine;
public class Flashlight : MonoBehaviour
{
public Light flashlight;
private bool isOn = false;
void Update()
{
if (Input.GetKeyDown(KeyCode.F))
{
isOn = !isOn;
flashlight.enabled = isOn;
}
}
}
This script enables or disables a Light component when the player presses F.
You can also adjust intensity dynamically:
using UnityEngine;
public class FlickerLight : MonoBehaviour
{
public Light pointLight;
public float minIntensity = 0.5f;
public float maxIntensity = 1.5f;
void Update()
{
pointLight.intensity = Random.Range(minIntensity, maxIntensity);
}
}
This creates a flickering effect for torches or candles.
Lighting is not just about light components. Environment lighting plays a huge role.
Go to Window → Rendering → Lighting → Environment. Here you can:
A skybox affects the overall lighting and reflections in your scene. Outdoor scenes especially benefit from a good skybox setup.
Light probes help dynamic objects receive baked lighting information. Without light probes, moving objects in baked scenes can look out of place.
To use them:
Now moving characters will blend better with baked environments.
Reflection probes capture the environment and apply reflections to shiny objects.
Place them in rooms or important areas. For indoor scenes, use multiple probes for accurate reflections.
Lighting is one of the biggest performance factors in Unity. Keep these tips in mind:
On mobile devices, even a few real-time shadowed lights can significantly reduce frame rate.
If you’re using the Universal Render Pipeline (URP) or High Definition Render Pipeline (HDRP), lighting behaves slightly differently.
URP is optimized for performance and works well for mobile and mid-range hardware. HDRP focuses on high-end visuals with advanced lighting features like volumetrics and ray tracing.
Choose your render pipeline based on your target platform.
Here’s a simple workflow you can follow:
Always test lighting in Play mode. What looks good in Scene view may feel different during gameplay.
Lighting in Unity is both technical and artistic. You need to understand the tools, but you also need to think like a cinematographer. Where should the player look? What mood are you trying to create?
Start simple. Use one main light. Add small lights with intention. Bake when possible. Optimize early if you’re targeting mobile.
With practice, lighting becomes one of the most powerful tools in your game development workflow. Master it, and even simple scenes will come alive.