Skip to main content

What's a lightmap?

Just as a model might have a basic albedo/diffuse map, a normal map, and etc., a light map is a texture applied to the surface of that model. Using Bakery or whatever, we pre-calculate the lighting using higher quality lighting calculations than we can afford in the actual scene, and then save it into a texture.

This means that your lightmapped models need a seperate set of UVs designed to hold the lightmap. These can be automatically generated in Unity by enabling "Generate Lightmap UVs" on the model file, or created in your modelling tool as a second UV channel. Blender can take an existing UV set and re-unwrap it as a lightmap UV to make this process easier.

Unity provides 3 options for lightmapping, which are exposed to Bakery. They are:

  • Baked Indirect will bake the indirect lighting into a lightmap, allowing you to choose whether the main light is included or added on top seperately. This means you can have scenes where the lightmap has baked lights while still containing a realtime sun or moonlight with dynamic shadows. This is pretty expensive, as the main light will need to still render realtime shadows for each object, but also the best looking.

  • Shadowmask will bake a lightmap containing the ambient light, and then a second map with the directional light shadow baked into it. This allows the light to use some of the benefits of a realtime light, like proper specular highlights, while avoiding the cost of realtime shadows for the baked part of the scene.
    Shadowmasks can then be combined with dynamic shadows, which looks nice and realistic. Or you can set the light to be fully baked with Occlusion Probes, in which case Unity will also bake a value into each light probe specifying whether it's being hit by the main directional light or not, making it look mostly the same but without player shadows.
    In Bakery, Occlusion Probes can be enabled from the bottom of the Bakery window.

  • Subtractive mode will bake a lightmap containing all the lights in the scene, but dynamic objects like players will still cast shadows. Those shadows will cut holes in the lightmap corresponding to the shadow colour. It's very optimised, but it looks kind of ugly.