Ambient occlusion and direct light render combined using post-processing software
An alternative technique to lighting a room is to use Ambient Occlusion. A typical workflow is to composite the Ambient Occlusion render onto a Diffuse rendered image that does not have any GI Diffuse rays. The advantage is that it is typically faster to render and can give more creative control when compositing. You will also not need to add any GI Diffuse or GI Glossy rays to the scene. However, it is not a physically accurate method and some experience with compositing is required to fine-tune the final look.
- Start by creating an Ai Ambient Occlusion shader and assign it to the room geometry. Increasing the Samples of the Ambient Occlusion shader to around 6 will reduce any noise associated with this shader.
- Render the scene using the Ambient Occlusion shader. It should like the image below:
Rendered using only the Ai Ambient Occlusion shader
- Now render the scene using direct lighting only (in this case area lights have been positioned outside the windows, but you could try other lights such as the Ai SkyDome light). However, in this case ensure that GI Diffuse samples are set to 0. You should notice when you render the scene that there is no bounced light and the back wall will be black. We will use the ambient occlusion in Nuke to 'fill in' the areas that have no bounced GI Diffuse light.
Direct light (Indirect 0).
- Open both renders in Nuke. Create a merge node and connect the Ambient Occlusion render to the 'A' input and the Direct light to the 'B' of the 'merge' node. Make sure the 'Operation' is set to 'Over'. Adjust the 'mix' to around 0.5. You should notice the Ambient Occlusion appear in the black areas of the 'Direct light' image. It should be obvious that we are in effect 'cheating' the use of bounced light using Ambient Occlusion.
The images below show the results of merging (over) the 'Ambient Occlusion' render onto the diffuse lighting (without GI) render. The benefits are that it is reasonably fast to render and does not contain any GI noise.
The images below show the result of rendering using an Ai Utility shader set to flat color, merged with the ambient occlusion AOV. This renders very quickly, however the results are far from photo-realistic.
You will need to download the SitoA plugin in order to use the StaEnvironment shader. Then, you can copy the sitoa_shaders.dll (or .so) file to your MtoA shaders folder.
The Ai StaEnvironment shader can be used as an environment map when connected to the 'White' attribute of the Ai Ambient Occlusion shader. This creates a reflective occlusion as the samples are distributed around the reflection direction instead of the surface normal. To do set this up you must:
- Create an Ai StaEnvironment and connect it to the White attribute of the Ai Ambient Occlusion shader.
- Connect a HDRI map to the Tex attribute of the Ai StaEnvironment node.
HDRI connected to 'Ai StaEnvironment' shader which is conncted to an Ai Ambient Occlusion shader
There are various modes that represent different mapping methods for the texture map that is assigned to the 'Tex' attribute. These modes are as follows:
The images below show the result of compositing the ambient occlusion 'Mode' render with the direct lighting render. When used appropriately it can add some interesting colored lighting to the scene. While not looking physically accurate the end result is very cheap to render.