Wednesday, August 1, 2007

Tutorial: AO and Baked Light Maps - Part 1

Given a simple test scene, come up with a way to speed up the render by baking in the more processor-intensive lighting, without losing shadow detail, and find a way to tighten up the shadow that's being caused by the skylight on the ground plane.

Rather than the typical, reference-based look-dev approach, and since we have a scene to start with, we'll just dig into the scene and see how the lighting and materials are currently handled.

A quick look and we see it's a simple scene with two objects with two simple materials on them. The lighting is handled by a small area light, which acts as our "key light" and gives us a slightly soft shadow, as well as rendercached skylight and 1 bounce GI.

The skylight and its GI are likely to be a slower part of this type of render, so let's texture-bake that into a light-map. We'll leave the key light out of the light-map so that we don't have to worry about losing any shadow detail.

Tip: In this scene you might be able to get away with baking in the key light too, but in a more complex example you would probably start losing too much detail.
We'll also need some better control of the skylight on the ground plane in order to tighten up that shadow, so let's exclude that ground from the skylight and use a Brazil2 Occlusion (Ambient Occlusion) texture instead.

In order to keep this all organized, we should set up a few render presets that we can easily switch back and forth between. At a minimum, we'll have a preset for the original lighting, one for fixing up the skylight shadow, one for baking the light-map, and one for rendering the light-mapped objects with the key light.