How to Bake Lighting in Unity Step by Step

To bake lighting in Unity, prepare static scene objects for global illumination, set fixed lights to baked, add probes for moving objects, then generate lightmaps from the Lighting window. Baking calculates lighting before the game runs, reducing runtime lighting work for static environments. This guide covers UVs, shadows, Light Probes, reflections, rebaking, and common problems.

What Baked Lighting Does in Unity

Baked lighting is lighting Unity calculates before runtime and stores in textures called lightmaps. Those lightmaps can contain direct light, indirect bounced light, and shadows for the scene’s static geometry.

This differs from real-time lighting, which Unity calculates while the game runs. Real-time lights can respond immediately to movement and gameplay changes, but they cost runtime resources. Baked lights are efficient at runtime because their illumination has already been calculated, but their result stays fixed until you bake again.

Treat baked lighting as part of the scene data, not as a live effect you can reposition during play.

A common approach is to bake fixed scene geometry while using Light Probes and selected real-time lighting for characters and moving objects.

How to Bake Lighting in Unity

Use this sequence on a saved scene. The choices in this table determine which objects need lightmaps and which need probes instead.

What Needs Lighting Set It Up As Why
Walls, floors, terrain, buildings, fixed props Mesh Renderer or Terrain, lightmap UVs, and Contribute GI These objects can store baked lighting in lightmaps.
A fixed lamp, sun, or interior fixture Light Mode set to Baked Its lighting is calculated before runtime.
Player characters, enemies, moving props Light Probes Moving objects cannot use a fixed lightmap position.
Glossy or reflective materials Reflection Probes Baked lights do not provide runtime specular highlights.

Step 1: Open the Lighting Window and Choose a Baking Backend

  1. Save the scene before changing lighting settings.
  2. In the Unity Editor, open Window > Rendering > Lighting.
  3. In the Lighting window, choose the baking backend before adjusting the remaining bake settings.

The selected backend determines which lighting settings are available and how some of them behave. Unity’s Progressive Lightmapper is the system that performs the precomputation in many current Unity workflows.

Keep the Lighting window open while you work. For a scene-wide list of lights and their important settings, also open Window > Rendering > Light Explorer.

Step 2: Prepare Static Meshes to Receive Lightmaps

  1. Select a static environment object in the Hierarchy.
  2. Confirm that it has a Mesh Renderer component, or is a Terrain object.
  3. In the object’s Inspector, enable Contribute GI.
  4. Repeat this for the geometry that should receive baked light and shadows.

Contribute GI is the important inclusion flag for baking. Marking an object Static alone does not guarantee that Unity will include it in lightmaps.

Next, prepare imported meshes for lightmaps:

  1. In the Project window, select the mesh or model asset rather than the scene instance.
  2. Open its import settings in the Inspector.
  3. Enable Generate Lightmap UVs.
  4. Apply the import changes.

Unity Editor’s lightmapping setup documentation identifies Generate Lightmap UVs as the straightforward way to prepare a mesh to store baked color in a lightmap.

Only mark geometry as Contribute GI when it benefits from detailed surface lighting. Large walls, detailed architecture, and objects with recesses or self-shadowing are good candidates. Small, simple, convex props often receive sufficiently believable indirect light from probes instead.

Also confirm that the object uses a material and shader that support lightmaps. A mesh with good UVs still cannot receive a useful baked result if its shader does not support lightmap data.

Step 3: Set Fixed Lights to Baked

  1. Select a light in the Hierarchy, or find it in Light Explorer.
  2. In the Light component Inspector, find the Mode setting.
  3. Set Mode to Baked for a light whose position, color, intensity, and shadow result will remain fixed during gameplay.
  4. Configure the light’s color, intensity, range, spot angle, and shadow options before generating lighting.

A light in Baked mode contributes its illumination to lightmaps and Light Probes before runtime, rather than participating in runtime lighting calculations. This is useful for ceiling fixtures, street lamps, room lights, and a fixed sun in a static scene.

For baked shadows, the shadow-casting geometry and the surfaces receiving those shadows need to be included in baked GI. The light must also be configured to cast shadows before you generate lighting.

Do not use Baked mode for a flashlight, a flickering gameplay light, a day-night sun, or another light that must visibly change during play. Use Realtime or Mixed lighting for those cases.

Step 4: Set the Lightmap Resolution

  1. Return to Window > Rendering > Lighting.
  2. Find the Lightmapping Settings section.
  3. Adjust Lightmap Resolution to control how much lightmap detail Unity allocates across the scene.
  4. Generate a test bake before committing to a higher-detail setting for the whole level.

Lightmapping Settings > Lightmap Resolution is the scene-level control for lightmap detail in Unity Editor. Raising it can improve the clarity of small shadows and lighting transitions, but it also increases bake time, lightmap texture memory, and build size.

Start with a practical test setting for the whole scene rather than trying to solve every shadow issue by increasing resolution. If one model has poor results, inspect its UVs, scale, material, and Contribute GI status first.

Step 5: Add Light Probes for Moving Objects

  1. In the Hierarchy, create a Light Probe Group.
  2. Place probes throughout the spaces where characters, vehicles, enemies, or movable props will travel.
  3. Add more probes near lighting transitions, doorways, corners, under overhangs, and areas that shift from sunlight to shade.
  4. Keep the probes inside the playable volume rather than leaving them only around the room perimeter.

Dynamic objects do not receive baked indirect lighting from the fixed lightmap beneath them. They use Light Probes, which store an approximation of the surrounding baked light that Unity can apply as an object moves through the scene.

A character standing in a bright doorway should therefore pass through probes that represent the bright exterior, the shaded threshold, and the darker interior. Widely spaced probes can make that transition look abrupt or make the character appear incorrectly lit.

Step 6: Add Reflection Probes Where Materials Need Gloss or Reflections

  1. Create a Reflection Probe in areas containing glossy floors, polished metal, glass-like materials, or shiny props.
  2. Position and size the probe volume to cover the reflective objects it should serve.
  3. Bake or refresh the reflection data using the mode appropriate for the probe and scene.

Baked lights do not provide specular lighting at runtime, including on dynamic objects. Unity’s baked-lighting documentation identifies Reflection Probes as the appropriate addition when the scene needs specular or glossy reflections.

Reflection Probes do not replace lightmaps. Lightmaps handle precomputed surface illumination and shadows; Reflection Probes provide environment reflection information for reflective materials.

Step 7: Generate and Inspect the Lighting

  1. Save the scene again.
  2. In the Lighting window, start the bake with the Generate Lighting control.
  3. Let Unity finish calculating and writing the lightmap data.
  4. Inspect the Scene view and Game view after the bake completes.
  5. Test both static scenery and moving objects before building the project.

Look for these finished results:

  • Static walls, floors, terrain, and props show the expected light and baked shadows.
  • Lights set to Baked have a fixed result that remains visible after entering Play mode.
  • Characters and moving props maintain believable ambient and indirect lighting as they move through the scene.
  • Glossy materials receive appropriate environmental reflections where Reflection Probes are present.
  • No important static mesh is unexpectedly black, overly bright, or missing shadows.

Changes to a Baked light, a static object’s position, its material, its lightmap UVs, or the lighting settings affect the stored result. Unity does not automatically update an already baked lightmap just because you moved something in the Scene view.

Dynamic Objects, HDRP, and Mobile Scenes

Dynamic objects use Light Probes with selected Mixed or Realtime lights, while HDRP and mobile scenes rely on baked lighting for fixed geometry.

Use Mixed or Realtime Lights When Gameplay Requires Live Changes

A Mixed light can combine baked information for static geometry with runtime lighting behavior for dynamic objects, depending on the project’s lighting mode and render pipeline settings. Realtime lights are the clearest choice when the effect itself must change continuously, such as a player-held flashlight or a rotating warning beacon.

Use this distinction when planning a scene:

  • Bake the room, building, terrain, and fixed fixtures.
  • Add selected Mixed or Realtime lights only where gameplay truly needs a changing direct-light effect.

Bake Lighting in HDRP

The core setup is to prepare static renderers for GI, use valid lightmap UVs, set fixed lights to Baked, place Light Probes for dynamic objects, and generate lighting from Window > Rendering > Lighting.

The exact lighting settings available can depend on the selected baking backend. Choose the baking backend first, then configure the settings that are available for the project.

Keep Mobile Lighting Focused

For mobile scenes, baked lighting is especially useful because it shifts work away from runtime. For mobile scenes, shift suitable lighting work away from runtime and use real-time shadows and lights selectively.

Lightmap resolution is a balancing tool on mobile. Higher Lightmap Resolution can make shadows cleaner, but it creates larger texture data and longer bake times. Test on representative target hardware before raising scene-wide detail.

Improve Bake Quality Without Making Bakes Unmanageable

Limit the number of objects marked Contribute GI to help minimize baking times.

Work through these checks before increasing lightmap detail:

  • Remove Contribute GI from tiny decorative meshes that receive nearly uniform lighting.
  • Keep large, visually important surfaces in the bake, especially where shadows, recesses, and bounced light are noticeable.
  • Test a limited scene area or a lower-detail setup before baking the full level.
  • Use Reflection Probes only in spaces where reflective materials need them.

The fastest bake is usually the one that spends detail only where players can see lighting variation.

Poor lightmap UVs can create overlapping, distorted, or fragmented lightmap areas. If a single imported asset has seams or strange lighting while nearby geometry is fine, inspect that asset’s UV generation before changing global lighting settings.

Check, Rebake, and Troubleshoot Baked Lighting

A bake is complete only when the result works in motion as well as in the Scene view. Move a dynamic object through bright and dark areas. Check the game from the player camera, not only from the editor camera.

When a Baked Light Does Not Update

A Baked light does not update automatically after you change it because its result is stored in the lightmaps.

Save the changed scene and use Generate Lighting again.

When a Static Object Is Black or Missing Baked Light

Check the object in this order:

  1. It has a Mesh Renderer or Terrain component.
  2. It is marked Contribute GI.
  3. Its material supports lightmaps.
  4. The scene has been generated again since the object was added or changed.

When Moving Objects Look Dark or Incorrectly Lit

Add or reposition Light Probes. A moving object needs probes throughout the places it occupies, especially around strong transitions between sun and shade.

If the object needs a sharp, changing direct shadow or specular highlight from a gameplay light, probe lighting alone may not be enough. Use an appropriately configured Mixed or Realtime light for that interactive effect.

When Baked Shadows Are Missing

Confirm that the light is set up to cast shadows and that the casting and receiving geometry is included in GI. Also inspect the mesh’s lightmap UVs; a mesh without usable UV space cannot store a clean baked-shadow result.

Frequently Asked Questions

What does it mean to bake lighting in Unity?

Baking lighting means Unity calculates fixed direct light, bounced indirect light, and eligible shadows before the game runs, then stores the result in lightmaps and probes. Static geometry uses lightmaps, while moving objects use Light Probes to receive an approximation of the baked environment lighting.

How do you rebake lighting in Unity?

Open Window > Rendering > Lighting, save the scene, and use Generate Lighting again. Rebake whenever you change a Baked light, move static GI geometry, alter a lightmapped material, change Lightmap Resolution, or adjust Light Probe placement.

Why does light baking take so long in Unity?

Bake time increases when more objects are marked Contribute GI, lightmap detail is high, geometry is complex, or the scene contains many light and shadow interactions. Reduce unnecessary GI contributors first, because small simple objects often work better with Light Probes than with their own lightmap space.

How do you bake shadows in Unity?

Set up a fixed light with Mode set to Baked, make sure its shadow casting is enabled, and mark the relevant static casting and receiving geometry as Contribute GI. Generate Lighting after the scene is configured so Unity can write the shadow result into the lightmaps.

How do you bake lighting in Unity HDRP?

In HDRP, open Window > Rendering > Lighting, choose the project’s baking backend, prepare static meshes with lightmap UVs and Contribute GI, set fixed lights to Baked, place Light Probes for moving objects, and generate lighting. Next, test the baked scene in the Game view on the hardware and render pipeline settings you plan to ship.