Normally, baking out a light-map is relatively straightforward, but in this case, we have mapped light (the custom Occlusion texture in the grounds Extra Light slot), skylight exclusions and GI exclusions, which creates a much more complex environment to create our baked lights in.
The key part from the original assignment for this part of the tutorial is, "baking in the more processor-intensive lighting, without losing shadow detail...". We said we'd leave the key light out of the bake so that we could preserve the shadow's clarity.
- Open the Starting-Point File
- File|Open... field-guide_ao_bake_end_part_3.max
- Render.
This is the point we left off from in part 3 of this tutorial. Since we're going to be changing the global light settings again, lets start by creating a new render preset to work with:
- Create a new render presets called "bake" by copying our "full render" preset.
- Open the Render Dialog and click the Render Tab
- Go to the "Brazil Bridge Renderer" rollout, and click "Manage..."
- Select "full render" from the list, and click "Clone"
- Rename the new preset ("Copy of full render") to "bake"
- Close the "Manage Brazil r/s Renderers" dialog box
- In the render panel, in the Brazil Bridge Renderer rollout, change the "Active Setup:" to "bake"
- turn off light-source direct illum for the bake pass
- Convert the teapot's material to white plaster for capturing the illumination
The goal of these next two sections is to convert the current materials to a material that will capture both the direct and indirect (bounce) light falling on the object. We don't want to capture the actual surface colors, specular highlights, etc., but we do want to capture the bounce light created by those surfaces. We do this using a Brazil2 Utiltiy material, using a simple white plaster material as the capturing material, with copies of our original materials used to generate all secondary illumination
- In the Material Editor, select the "teapot" material.
- drag and drop the "teapot" material swatch to an unused slot to make a copy of it.
- Working on the copy you just made, click the material's "Type Button", which says "Brazil2 Advanced" and select a Brazil2 Utility Material.
- Select "Keep old material as sub-material?" when prompted.
- 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.
- Select "Copy" when prompted.
- Click the map button in the "Base" slot of the Utility Material
- Change this material to a white-plaster type:
- Set the Material's "Diffuse (Cs)" color to white (255,255,255)
- In the Material's "Highlight Shader" rollout, change the highlight shader from "Phong Highlight" to "None"
- Click the "Put to Scene" button
to apply this material to the teapot. - Render.
- Convert the plane's material to white plaster types for capturing the illumination
- drag and drop the "plane" mtl swatch to an unused slot to make a copy of it.
- Working on the copy you just made, click the material's "Type Button", which says "Brazil2 Utility Material" and select a new Brazil2 Utility Material.
- Select "Keep old material as sub-material" when prompted.
- 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.
- Select "Copy" when prompted.
- Click the map button in the "Base" slot our top-level Utility Material
- Click the material "Type Button" and select a new Brazil2 Advanced Material
- Change this new material to a white-plaster type:
- Set the Material's "Diffuse (Cs)" color to white (255,255,255)
- In the Material's "Highlight Shader" rollout, change the highlight shader from "Phong Highlight" to "None"
- Click the "Put Material to Scene" button to apply this material to the plane object.
- Render.
The plane comes out black... not what we want. Why? Because the plane is excluded from the scene's skylight illumination and GI -- Once again, we need to explicitly map the illumination onto the plane, using that same Occlusion map we created before.
- In the material editor, on the white-plaster material we just created, open the Brazil2 Advanced material "Basic Surfaces Properties" rollout, and click the button that says, "(None)" in the "Extra Light" channel.
- In the "Material/Map Browser" Click the "Browse From: Scene" radio button.
- Double Click one of the "Brazil2 Occlusion" textures that you see to assign the Ambient Occlusion texture to the Extra Light slot.
- Choose "Instance" when prompted for to choose "Instance or Copy".
- Render.
Now the ground renders as white, with our modified skylight shadow.
- bake the light map using render to texture
- In your max scene, select all your objects (multi-select both the teapot and the plane)
- In the Menu, select Rendering | Render To Texture...
- In the "Render To Texture" dialog, Change the "Output" path to a location of your choice.
- In the "Output" rollout, click "Add" and choose "CompleteMap" from the "Add Texture Elements" list.
- Change the output size to 512x512
- In the "Baked Material" rollout, select "Render to Files Only" -- we will remap these into the scene by hand so that we have an understanding of how these are used.
- Click the "Render" button in the Render To Texture dialog. The baked light maps are rendered and saved.