🤔

Lightmapping#

Steps to baking lights#

1. Create lightmap UVs for your models#

Enable Generate Lightmap UVs in the model tab of the Model Import Settings window.

Or

Populate the second UV channel in your modelling program of choice.


You can check imported UV channels by selecting the imported Mesh sub-asset, and changing the preview window's Display Mode to UV Layout, and navigating to the UV channel. Your lightmap UVs should appear in Channel 1.

2. Mark unmoving geometry as static#

Enable static flags on the GameObjects that you want to include in your bake.
Contribute GI and Reflection Probe Static are the lighting relevant flags.

Static objects cannot be moved in the scene at runtime. If you want to light dynamic objects with baked lighting data see step 4. Certain small or complex objects may be unsuitable for lightmapping and also may benefit from step 4.

3. Mark your lights as baked#

Select the lights that should contribute to your lightmaps and change the Mode to Baked.
You can use Mixed if you understand the scene's Lighting Mode settings and how the effect this has on your bake.

4. Use Light Probes for moving or complex objects#

Moving objects cannot be included in baked lighting. Complex or small objects may also be unsuitable for lightmapping. Light Probes exist to sample and blend baked lighting information for these dynamic objects.

  1. Create a Light Probe Group and place its probes.
  2. In the Renderer's settings ensure Receive Global Illumination is set to Light Probes.
information

If you use HDRP you can make use of Adaptive Probe Volumes, which automate placement of light probes and provide per-pixel lighting.

5. Configure reflections#

By default, the sky is sampled for reflections. This can often make dark areas appear bright and incorrectly lit.
Configuring Reflection Probes to provide approximate reflections for different areas of your scene will produce more accurate lighting.

6. Choose your Lightmapper#

If you have a capable GPU, switch to the Progressive GPU Lightmapper, as it will generally bake faster.

  1. Open the Lighting window (WindowRenderingLighting).
  2. Under Lightmapping settingsLightmapper select Progressive GPU

7. Generate lighting#

  1. Open the Lighting window (WindowRenderingLighting).
  2. Select Generate Lighting at the bottom of the window.

Return to lighting.