Lightmapping Troubleshooting Guide

Chapter 25: Optimize scene setup for bake performance
25.1 Probe-lit vs. lightmapped objects


Figure 56. Screenshot from the Lighting Optimization Tutorial (left). GI Contributors scene view mode shows lightmapped objects (blue), objects that contribute GI, and receive lighting from light probes (red), and objects that do not contribute to GI, but receive lighting from light probes (yellow).

Keeping the amount of occupied texels low is beneficial to bake times and the number of lightmaps. One way to achieve this is by keeping lightmap resolution down. In some cases, a better solution would be to rely on light probes for lighting. Probe-lit objects will not occupy space in the lightmap atlas but can still influence the global illumination if the user chooses to.

Lightmap objects which will contribute to GI in a major way. Objects such as terrain, buildings, and other large meshes, are ideal for lightmapping. Objects such as fences, pebbles, wires, and other small props are excellent candidates for probe lighting.

Dynamic objects will sample light probes by default but will not contribute to surrounding lightmaps. If you want probe-lit objects to cast baked shadows, and influence the GI, check the Contribute Global Illumination flag in the Mesh Renderer component. Receive Global Illumination dropdown should be then set to Light Probes.

25.2 Non-visible geometry
Do not lightmap objects that the player will not see. Lightmapper still takes such geometry into account during the baking process. This will increase bake times and lightmap occupancy.

25.3 LODs
We are planning on improving this workflow in the future by introducing a lightmap projection feature.

It is not recommended to lightmap objects in every layer of the LOD Group. Doing so will increase bake times. Instead, consider lightmapping objects in the LOD0 layer, and using light probes for the lower layers. This will improve bake times and reduce lightmap occupancy. In most cases, the transition between lightmapped and probe-lit LODs should not be noticeable.

25.4 Light grid
Light grid is a three-dimensional grid which envelops static scene geometry and baked lights. It checks the number of lights in each cell which will affect the nearby texels.

Progressive GPU lightmapper uses a dense light grid which it scans through very fast. Progressive CPU lightmapper uses a coarse adaptive grid which can expand, or shrink, based on the scene setup.

To speed up the baking process while using the Progressive CPU lightmapper, keep the following in mind:

  • Limit the number of baked and mixed lights in the scene.
  • Do not place baked lights at high distances from one another. Even a single baked light placed at the edge of the level far away from other lights will stretch the light grid. This will slow down the baking speed.
15 Likes