Lightmaps: A Primer

There isn't room in this article for a detailed explanation of Lightmapping, but I do need to mention it since it may be something you work with at some point.

Whether or not you work with lightmaps is going to depend on the tech and the game engine being used where you work.

For those unfamiliar with the term, Lightmapping is "baking" the lighting into textures, usually using a second UV set that's been assigned to the objects in your scene. Different methods are used for rendering and lightmap setup, but bottom line is that if you work somewhere that uses an engine that does lightmapping, and it's a central part of the process, lightmaps will be a major part of your daily work.

Way back in 2007, I wrote an article about the lighting in Insomniac's game "Resistance: Fall of Man". I said in that article that lightmapping probably wouldn't be around much longer, but here we are 11 years later, and lightmapping is still used in a number of game engines.

 

Lots of lights

One benefit of working with baked lighting is that you can use hundreds of lights in your levels.

 

Lightmapping is still used in both Unreal 4 and Unity. (You have the option to not use lightmaps though, if you don't want to for your project, and just use dynamic lighting.)

CryEngine was the first time I worked with an engine that did no lightmapping at all.

Even the types of lightmapping vary from engine to engine. For instance, at Insomniac, the engine we worked with at the time baked a separate lightmap for every object in the game. But at 343, a single, huge, lightmap was baked for the entire level. By the time of this writing, both companies have moved on to newer engines, and probably do things differently now.

There are pluses and minuses to each system. Baking the lightmap for the entire level ensures that everything in the level is up to date, but it takes longer. Baking a lightmap per-object means you can just select a few objects in your level and bake them on their own, which will be a lot faster, but there's no guarantee other objects nearby are up to date.

At one place I worked, the Lighting Artists were the ones responsible for creating the lightmap UV sets on all objects. But in most places, the Environment Artists create the lightmap UV sets (along with the regular textures and UVs) when they create the asset.

Lightmaps are not the only way to store lighting information in a model (or a level.) Vertex Lighting is something else that's sometimes available, and is usually used on objects that are smaller, and have a lot of vertices. Lighting values are baked into the vertices on these objects, so no lightmap is needed.

In addition, some systems allow you to use both lightmapping and vertex lighting on the same object.
For instance, a flight of concrete stairs with a metal railing would be a good candidate for a mixed system, as the large surfaces of the stairs and staircase would benefit from a lightmap, and the thin railing (if it has a good number of vertices) could be a good choice for vertex lighting. The geometry from each would be flagged as to the type of baking to use. (Lightmapped or Vert lit.) Although vertex lighting means no lightmap is required for that geometry, vertex lighting is not free, and has a cost of it's own.

Here's some Wikipedia info on Lightmaps.

 

Next: PBR and You