Global Illumination for the Beginner

Preface

Years ago, before Max's advanced lighting and mental ray reached the scene, global illumination was simulated through the careful placement and adjustment of standard lighting. It was more an art than a science. Now, with advanced renderers and photometric lighting, global illumination has become more a science than an art. You will learn that in global illumination there are numerous ways to achieve a satisfying result, perhaps as many ways as there are those who use it.
This tutorial was created with Max 7 using mental ray version 3.3. I can only guarantee comparable results for those using the same versions of this software. Use of other packages will most likely lead to differing results.
Let's get busy....

Step 1: Setting Up Our Directory

For this tutorial you will only need to download file, Global_Room.rar. All the needed geometry and mapping are included in this file. Once you've downloaded it to your PC, create a new directory in the Scene directory of Max and label it Global_Rooms.

Into this newly created directory you will want to uncompress the needed files.

Download the Global Room file here.

There are four Max files in Global_Rooms, one called Small_Room.max and the other Global_RoomMR.max, each with a finished version. We'll start with Small_Room.max, which will give you a chance to see how easy it is to create global illumination in a very simple room.

Open Small_Room.max and take a few moments to study the simplicity of the scene. Your first view will be of an average sized room, 168 inches by 168 inches by 96 inches, in smooth and wire frame view. The single light source is a Photometric Free Point light positioned to act like a typical ceiling light. Hit the C key to view the room through the camera, then F9 for a quick render. The default scanline render shows us a very dark room; the green sphere in the corner is barely visible. Photometric lights are designed to be used by either Max's advanced lighting or mental ray's Indirect Illumination. Now, let's switch our renderer to mental ray and enable Global Illumination before we try the render again. Close the Render window. Hit F10 to open the Render Scene panel, click the Common tab and slide all the way down to the bottom. Open the Assign Renderer rollout, and click the button to the right of Production: Default Scanline Renderer to open the Choose Renderer panel, double click mental ray Renderer



If you were to render right now, you'd find the rendered image still dark, so let's enable Global Illumination. While we have our Render Scene panel available, click the Indirect Illumination tab, then click the Enable option box in the Global Illumination area. Leave all the other settings to their defaults for now. Now, click the Render button at the bottom of the panel. Your render should look like this:

Step 2: The trouble with Photons

Take a VERY close look at the patterns that produce this splotchiness, especially on the sphere. You may need to zoom in on this. Looks like circles, doesn't it? They are, and those circles are the photons, and the pattern that they strike the diffuse surfaces produce this splotchiness. Photon size is directly calculated from the size of the entire scene and not the object it's striking. If you have zoomed in on the sphere, also inspect the area of the floor around the base of the sphere. You should just be able to detect a hint of green that's been bled onto the floor from the sphere. This is called "Color Bleed". Both Color Bleed and the splotchy patterns are known as "Artifacts". Typically, some would want to go to Final Gather, but let's try another method of dealing with this splotchiness. Close the rendered image and return to the Render Scene panel. In the Global Illumination section, click the option box to enable Maximum Sampling Radius, and enter a value of 12". Click the Render button to see what this new value does for your render. See image below:

No change? Of course not, the value of 12" was near the value calculated by mental ray as the photon size. Now, close the rendered image, enter a value of 48" and render again:

Much better, the walls are nice and smooth enough for us to move on to the next area that needs to be improved upon, the light levels. Close the render image window. In Max with mental ray there are four primary ways to increase the level of light in a scene:

1. Increase the intensity of light on each individual light or instanced group of lights through the Modify panel.
2. Increase the Global Energy Multiplier in Light Properties on the Render Scene panel.
3. Decrease the decay level in the same area as above.
4. Increase the "Bounce Factor".

Step 2: The trouble with Photons

Any of the above four would work to brighten our scene, but only two of these will we look at. The first of these, Global Energy Multiplier, is fairly self-explanatory. Let's try it out. Slide down just a touch on the Render Scene panel to where you'll find the Light Properties area. Increase the Global Energy Multiplier to 1.5, then click Render at the bottom of the panel. Your scene should like this:

Our scene is lighter, but is this best we can get? Let's clone our render for a later comparison. Click the clone button (see yellow highlight on above image) to clone a copy of our render. Minimize the copy and close the original rendered image panel. In the Render Scene panel, change the Global Energy Multiplier back to its default value of 1, then just above that area, look at the area for Trace Depth. In the most simplistic of explanations, Trace Depth, with respect to Global Illumination, sets limits on how many times a photon can be reflected/refracted off of objects. Increasing trace depth also increases illumination. In the Trace Depth area of the panel, enter a value of 16 for Max. Depth, a value of 15 for Max. Reflections and lower (if necessary) the Refractions value to 1. Render. See below:

Once the render is complete, call up the cloned copy of your previous render and compare the two. Initially, your first observations would be that the newest render is slightly darker, but take a close look and comparison of the corners in both renders. The corners are better defined in the render with the increased trace depth and the artifacts are slightly less pronounced. We will follow the greater trace depth method for this tutorial. Close both of the image windows, and save your file. At this point, we are ready go to Final Gather.

Step 4: Final Gather

Final Gather is an option in global illumination, a tool that can be used alone or with your global illumination settings to help filter out artifacts and smooth the end result. In the this tutorial we have been working to help prepare the scene for Final Gather, so both will be used. If not already opened, hit F10 to call up the Render Scene panel and slide down to the Final Gather rollout. Click the Enable option box to enable Final Gather. The only value we need make an adjustment on at this time are the Samples. The value of 1000 is excessively high, and since we've made several adjustments to prepare our scene for this step, we'll start with a value of 200. Enter 200 into the Samples value, and click Render. Be prepared for a good wait.

See image below (Samples = 200):

It's possible that some of you might have gotten a flawless render, while others have a few vestiges of artifacts showing in the image, particularly in the corners. While creating this tutorial, and through practical experience in mental ray, I have found that there are times when mental ray Final Gather can be quite fickle in its renders. One time you can do a flawless render with a file, then try a second time with the exact same settings and exact same file to find artifacts present. Rather than increase the samples (thus increasing rendering time) look just beneath the Samples and you'll see Filter. If you have artifacts present, increase this value to 3 and render. Filter increases the number of rays used for filtering, thus, smoothing out the illumination further.

With this, our artifacts are fairly well removed, and the sphere is now brightly colored as it should be. This part of the tutorial was designed to show you how easy it is to work in global Illumination with a fairly simple room. Before moving on to the second part of this tutorial, take the time to create your own small room and illuminate it with what you've learned. Refer to the user reference to look up anything you're uncertain of or curious about. Experiment with settings. Try different sample values, photon sizes, lighting positions, room shapes, etc. A little experience now can save you a lot of frustration later on. Let's proceed with the second part, a real world room.

Step 5: Global Illumination and the Real World

We now move on to our second file. Open GlobalRoomMR.max. Your first view of this room will be in the perspective viewport and in wire frame mode. GlobalRoomMR is a basement den, measuring in imperial units of 312 by 240 inches. All lighting in this room is by artificial means. To illuminate this area 9 free point lights (photometric) were used. Take a few moments to look over the room, using Arc Rotate/Pan to maneuver the scene. Compare it to SmallRoom which was quickly constructed of boxes. The additional geometry (table and chairs, pedestals and helical sculptures) are from my junk geometry collection to help fill the room. Once you feel familiar with the scene, hit C to switch to the camera view and F9 for a quick render. mental ray and Global Illumination have already been enabled.

To most beginners, what might seem odd in this render is the aspect ratio and the presence of concentric rectangles in the camera viewport. The latter of these is known as Safe Frames (Shift F), and these are used to help you compose your image when your chosen aspect ratio differs from the aspect ratio of the viewport. To compose this image I chose an aspect ratio of 1.66:1, using the outermost rectangle to adjust the view. Note the artifacts present in the newly rendered scene, the familiar splotchiness in the chairs and a new one above the stairwell arch known as "light leakage". Our lighting levels for this render look fine, but we still need to assign our materials to their respective objects before we can make a final determination on our lighting. This will be our next step, but before moving to Step 6, clone your rendered image, then minimize it. Close the Render window.

Step 6: Assigning Materials to the Scene

The materials have already been created but need to be assigned. Call up the Material Editor by hitting M, and to make this a little easier, hit H to call up the Select Objects list. In the Objects list, select all 6 Shell Lights and click the Select button. In the Material Editor, select the first material called Shell Lights (a self illuminated material) and click the Assign Material to Selection button. See highlighted button below:



Now, the material has been assigned to the Shell Lights that are used in the built-in shelving. In the Material Editor select the second slot called "Walls", then hit H to call up the Select Objects list again. In the objects list, click Walls, then the Select button and assign the second material to the walls. For the remaining four materials, follow the previous procedures to assign the materials to their objects:

Flooring material to Floor
Pedestals material to IlluminatedPedestalsLeft and IlluminatedPedestalsRight Furnishings material to ChairSouth, ChairEast, ChairWest, ChairNorth and Table Ceiling material to Ceiling

Close the Material Editor. The stairs and the helical sculptures are not assigned materials, these will remain the default grey. Hit F9 to quick render then compare your results to the clone you made for the last render without materials.

In comparing the two renders, the light levels are still acceptable, however, we've added an additional artifact of color bleed rising from the floor to the ceiling. Showing you how to get rid of color bleed at this time is purely an academic point as during Final Gather color bleed can return as it will with this scene. To rid your scene of it now, first close the clone and the render panels to clear the work area. Hit H to call up the Select Objects panel, and select Floor from the list. Right click on the floor, and click Properties in the Transform part of the quad menu. Click the mental ray tab of the Object Properties panel, then click the option box for Generate Global Illumination to disable it. What we've done is to stop the floor object from reflecting any photons from its surface. When photons are reflected from the surface of an object it carries with it the color information from the previous object as well. Click OK to close the panel and hit F9 to render.

Step 7: Reflections

From our last two renders you might have noticed our floor isn't very shiny, and that our furnishings seems rather flat. The floor should have a nicely waxed finished and the furnishings are molded black acrylic. If you explored the Material Editor while applying the materials to the objects you might have noticed that two of the materials had raytrace applied to their reflection maps. Now, we'll activate these reflections and do another quick render. The two materials are Flooring and Furnishings. Hit M to bring up the Material Editor, click the third material slot for Flooring, open the Maps rollout, then click the option box left of Reflections to enable it.

Repeat this step for Furnishings. Close the Material Editor. Hit F9, and compare your results with below:

The reflections and lighting look good at this point, leaving us with only a few artifacts to tend to. This would be a good time to try a render with Final Gather. Close the Render window. Hit F10 to bring up the Render Scene panel, click the Indirect Illumination tab and slide down to the Final Gather rollout. Enable Final Gather by clicking the option box, reduce the Samples value down to 200 and click Render.

This will take some time to finish. See below:

This is a definite improvement. The light leakage and splotches are far less pronounced and the texture of the stucco walls has become more visible. If you look closely at the ceiling you will see that the color from the floor has bled back onto it, but like the first time it's hardly enough to concern ourselves with and even adds some character to the scene. Let's finish this scene by increasing the Filter value in the Final Gather area to 2 and render again. See below:

Despite a slight problem at the base of the stairs which could be quickly corrected with some post production work, this is where I would finish. Attempting to correct such a minor problem with Max and mental ray would take far more time than the few minutes it'd take to correct it with a good graphics editing program. Take the time to experiment with this scene by changing values in the Render Scene panel, using your own maps/materials or adding your own models into the scene. Refer to the User Reference under Help on the menu bar and use the tutorials that come with the program. Good Luck and Happy Maxing....
 
Rick Timmons
DigitalPrizm

Enter content...

Fetching comments...

Post a comment