Tutorial – Automatic Lightmap Rendering

How to bake lighting data into the textures in your project by rendering lightmaps

5a Title Lightmap Rendering E1393940837214

Rendering lightmaps

Adding more lights to a project makes it possible to achieve subtle lighting effects, but at the cost of increased calculation times. One way around this is to render lightmaps. This incorporates lighting information into the surface textures of the models. Because the highlights and shadows are effectively ‘baked’ into the surfaces, the lights that created them are no longer needed in the scene, making it more responsive to work with.

To demonstrate this, we’ve created a project based on Mies van der Rohe’s famous Barcelona pavilion. It is lit using image-based lighting and a single directional light that casts strong shadows beneath the roofs of the pavilion.
5a_01_1

To bake the lighting, we can select Render Lightmaps from the Render menu.
5a_01_2

A new dialog appears. We just click Continue.
5a_01_3

Now the RENDER LIGHTMAPS dialog appears. We will look at what the settings do in a minute. For now, we will just click Render to begin calculating the lightmaps.
5a_01_4

This process can take a few minutes. For a complex scene, you may want to schedule it to run over lunch, or during a coffee break. The time required for automatic lightmap rendering vary depending on the number of polygons and other characteristics of the scene.
5a_01_5

And here’s the result. The lighting information has been baked into the surface textures of the objects.
5a_01_6

Setting lightmap quality

Now let’s look at what the settings in the RENDER LIGHTMAPS dialog do. The Resolution drop-down determines the size of the new texture maps CL3VER will generate in pixels. Raising this setting increases image quality, but at the cost of longer calculation times.

Below, you can see a side-by-side comparison of two of the Resolution settings.
5a_02_1_new

Antialiasing determines how smooth edges will appear. The effect can be subtle, but higher values will result in higher image quality – again, at the cost of longer calculation times.
5a_02_2

Gather Samples determines in how much detail CL3VER will sample the lighting in the project before baking it into the texture. Below a certain threshold, this setting has a major impact on the quality of the lightmaps.
5a_02_3

The final two settings from the AUTOMATIC COORDINATES rollout, UV margin and UV angle threshold, control the placement of the baked textures over the surfaces of the models in the project.