Diagram · How lightmap resolution, atlas count and compression affect memory use
Diagram · How lightmap resolution, atlas count and compression affect memory use View full-size figure

Budget in atlases, not resolution

Deciding lightmap quality usually starts with the resolution field, while the final cost shows up as how many atlases got baked. Texel density is per unit area, so doubling the value quadruples texels and the atlas count follows.

Invert the order. Decide how many atlases this scene may spend, then find the resolution that fits.

What to check before baking

  1. An object without a static flag receives no lightmap no matter how long you bake.
  2. An object that should receive one needs lightmap UVs, or the generate option enabled.
  3. Compression shrinks size and puts banding in gradients. Verify on device.
// Find the missing static flags first
foreach (var renderer in FindObjectsByType<MeshRenderer>(FindObjectsSortMode.None))
{
    var flags = GameObjectUtility.GetStaticEditorFlags(renderer.gameObject);
    if ((flags & StaticEditorFlags.ContributeGI) == 0)
        Debug.LogWarning($"not contributing to GI: {renderer.name}", renderer);
}

Bake time grows faster than quality

Keep raising resolution and bake time climbs visibly while the on-screen difference does not. To find where to stop, compare two values on the device screen. The editor view exaggerates the gap.

[Bake] resolution 20  atlases 2  time 00:04:11
[Bake] resolution 40  atlases 6  time 00:19:52
[Note] on device the difference is much smaller than in the editor

Expected result and next step

Picking a resolution inside a fixed atlas budget finishes this item. Memory is next: more atlases mean more runtime memory, so confirm it with a profiler snapshot.

Verification scope

Official documentation review

Verified

Reviewed the article's code and procedure against official Unity documentation and marked it ready for publication. This is not a claim of an independent Unity project or device reproduction; version- or device-specific reports will be checked in that environment as follow-up.

Official documentation checkedLightmapping ↗