Global Illumination, Final Gather and Caustics, these are the three individual elements that we commonly use as 3D artists to simulate the effects of bounced and focused light. We will explore each of these in the following sections with theory and practice.
The underlying principle of Global Illumination is that light, in the real world, can exhibit the ability to reflect off of any surface. The more luminous the surface (the whiter the surface), the more light will be reflected. Since light is reflected off of all materials along the properties of Diffuse-Gloss-Specularity-Reflectivity, we should assume that when multiple objects of a luminance greater than pure black (everything except for black holes) are present in our scene, that light will reflect back into the shadow areas on nearby objects from that surface. This principle is used in Hollywood, in photographers' studios and on television sets by having stagehands hold up brightly coloured reflectors or use bright backdrops when filming with directional light to lessen the shadows on actors or items.
It can also be observed in everyday situations, such as when light enters through a window, hits a wall and reflects off to the ceiling. This is called a diffuse reflection, since the walls have no reflectivity/specularity to them and it is merely their albedo (or overall tonal value) that controls how much light bounces. A white wall will of course bounce more light than a darkly painted wall. You can see in Fig.01 that the colour of the light (in this case orange from the morning sun) will also be transferred.
As we set up global illumination, we need to observe how the light bounce will affect the shadow areas. In the simple demo image below, the light rays emitted from our source (spot light) will bounce off of the ground plane and onto the shadow side of ball, thus lightening the shadow as we see in Fig.02.
To Render Global Illumination with Mental Ray
First, let's build a simple room to test everything out. Here I have a cube-shaped room with one window. Inside the room I have two big orange and purple – let's call them "abstract minimalist paintings" – propped against the walls. In the centre of the room there is a cube-shaped "table", on top of which there is another "abstract minimalist sculpture" – a sphere. And hey, I've even put a chair in the room to make it interesting. All told, this scene has 1401 quads, so that's a pretty small polygon count. For the purposes of this demo, I will be using Maya 2009 with Mental Ray 3.7, rendering on a Quad Core Intel Xeon 2x3Ghz Mac Pro, running OS 10.5.5 with 4GB of 667 DDR2 RAM. All of my test renders were done at 1280x720, at Production quality Anti-Aliasing Settings. That is mentioned so that you can calibrate your render times to my own.
I have also used the Distance tool to determine that the upper far corner of the room is roughly 24 units away from the lower near corner. Notice how I am measuring my scene diagonally in 3D space (Fig.03). This measurement will be important in future steps (see: Determining Accurate Global Illumination Scale below).
Additionally, I have decided to test the scene using Maya's Physical Sun and Sky simulator, which is an easy way to create some realistic direct day lighting effects. Setting this up and altering the values will not really be covered in detail in the course of this tutorial, however. Below you can see an image of where to create this Simulator. What it does is create a directional light in the scene. The angle that you point the directional light colours and changes the intensity of the daylight to mimic the position of the sun. On this light I have enabled Raytrace Shadows, and Raytracing is on in my scene by default (allowing those shadows to be diagnosed) (Fig.04).
Created along with the Physical Sun and Sky simulator is a lens shader which gets attached to each of the cameras in your scene automatically. Below are the settings in this Lens Shader that I have altered to set up the scene (red dots indicate values that I have changed). I have changed these exposure settings to be more physically correct to my scene than the default values would otherwise give me (Fig.05).
Before I set up any Global Illumination settings, let's see what would happen if I rendered this scene out right now. The scene looks incredibly dark because the only light that we pick up is what is coming from outside of the window (the direct light only), and since there is only that one light in the scene, everything falls in shadow. Well, time to fix this with the Global Illumination (Fig.06 – render time = 0m 05s).
So, to set up Global Illumination, open the Render Settings window and enable Global Illumination. Don't alter any settings yet, we will get to that in a bit (Fig.07).