Tuesday, August 14, 2007

Tutorial: AO and Baked Light Maps - Part 3

... continued from part 2
Switch back to our "full" lighting scheme, and do fix-up as required to get back to our original look:
  1. Open the Starting-Point File
    1. File|Open... field-guild_ao_bake_skylightfixed.max
    2. Render. This is the point we left off from in part 2 of this tutorial
  2. Switch back to the full-render preset and render
    1. In the render panel, in the Brazil Bridge Renderer rollout, change the "Active Setup:" to "full render"
    2. Render.
      What you get now is an overly bright, red/pink image -- the ground plane is too bright, and the teapot has way too much red bounce from the ground -- so let's think about what's happening. First, the ground plane is really bright, which would make sense since it's both self lighting due to the Occlusion map and it's also receiving skylight. So let's exclude this from skylight. With any luck, once the ground is fixed, the teapot will get back to normal:
  3. Exclude the ground plane from skylight in the "full render"
    1. select the ground plane in the scene
    2. Right click the "Receiver Exclude..." button in the Luma Server's "Skylight" section and select "Add Selected"
    3. Render.
      Problem: The groundplane is still overbright, so what's up? It turns out that We've stumbled across a bug here. At this point, we report the bug. :) We found, through experimentation, that we could get the plane's brightness where we expected by adding the plane to the renderer's GI "Receiver Exclude...". So, with the plane still selected...
    4. Right click the "Receiver Exclude..." button in the Luma Server's "Global Illumination" section and select "Add Selected"
    5. Render.
      Now the ground-plane looks good, but the teapot is still too bright. This one was a bit trickier to figure out. After a bit of trial and error, it was discovered that the "Skylight" checkbox is turned off in the QMC Sampler section of the Luma Server. We investigated this, and sure enough, if you take the original scene and turn on that checkbox, the teapot gets much pinker, like we're seeing here. So, we now have a self-illuminated object (the ground) that's illuminating the teapot, which is the same thing skylight would have done by simply reflecting off the ground in the first place, but the skylight contribution had effectively been excluded from the teapot. Our Occlusion map has replaced the effects of skylight on our ground-plane, so how do we exclude the effects of just that Occlusion map from the teapot? Sounds like a job for the Brazil2 Utility material. We'll use the Utility material to decouple what's seen directly by the camera from what's seen in the GI bounces:
  4. Put the "plane" material into a Brazil2 Utility material to get better control of its GI characteristics
    1. In the material editor, select the "plane" material.
    2. click the material "Type Button", which says "Brazil2 Advanced" and select a Brazil2 Utility Material.
    3. Select "Keep old material as sub-material?" when prompted.
    4. Open the "Global Illumination Parameters" in the Brazil2 Utility material and drag/drop the "plane (Brazil2 Advanced" material from the "Base" slot above into the "Material" slot of the Util mtl's GI params.
    5. Select "Copy" when prompted.
  5. Turn off the Extra Light that's coming off the plane when seen as indirect illumination (aka GI bounces)
    1. Click the "plane" material in the Util Mtl's GI Params rollout so that we can edit this sub material
    2. In that Brazil2 Advanced material, navigate to the Basic Surface Properties panel and click the checkbox to the right of the Extra Light slot -- this will turn off the Extra Light that's being seen in the GI bounces
    3. Render.
At this point we're back to the look we want and we've modified the skylight shadow below the teapot as directed. This isn't this difficult when you're not combining both GI and skylight with some odd settings, but now that we've got this working, we can move on to baking the GI and skylight into light-maps.