3ds Max Lighting and Rendering - Faking Global Illumination with Ambient Occlusion
Ambient Occlusion is a technique developed by ILM to improve lighting without requiring full global illumination computations. It gives the effect of complex lighting and shadowing without the computations. It is not as accurate as the more complex solutions, but the results are often compelling enough.
- Recorded in: 3ds Max 2011
- This tutorial is intended for use with 3ds Max version 2011 or higher.
00:00:00 --> 00:00:05
In this movie, you explore various ways of using Ambient Occlusion
in 3ds Max.
00:00:06 --> 00:00:10
First, a few words about Ambient Occlusion, or AO for short.
00:00:10 --> 00:00:17
AO was invented by ILM in 2002 as they were working on the movie
00:00:18 --> 00:00:23
It is meant to simulate Global Illumination without requiring
full GI computations.
00:00:23 --> 00:00:29
The shader was written to "occlude", i.e. to block light from hitting
a certain point.
00:00:29 --> 00:00:32
This is dependent on the objects surrounding that point.
00:00:33 --> 00:00:41
Ambient Occlusion starts from your position looking at the scene. Every
single point visible to your eye gets calculated in the following way:
00:00:41 --> 00:00:48
A number of rays are cast from that point in a randomized, hemispherical
way, out to do "hit-tests" on the rest of the scene.
00:00:49 --> 00:00:56
You specify the number of rays to be cast. The more rays you specify,
the better the result but the longer the rendering time.
00:00:57 --> 00:01:05
Some rays collide with other objects, some don't. The surface point is
then shaded by a ratio of hit-rays, in this case 2/6.
00:01:06 --> 00:01:10
The more occluded a point and the darker it appears in the final render.
00:01:11 --> 00:01:15
For better results, you also define how far the rays travel.
00:01:15 --> 00:01:22
A travel distance of 0 makes the rays travel indefinitely. You usually
want to define a distance that fits the scene well.
00:01:23 --> 00:01:29
AO is relatively fast. It can even be used in a scene that has no lights
and still improve it tenfold.
00:01:29 --> 00:01:31
Let's put it to practical use.
00:01:32 --> 00:01:38
This scene is set inside a modern apartment. At this time, no lights
are used and the render looks bland.
00:01:39 --> 00:01:43
The rendering engine is set to Mental Ray, otherwise, you cannot use
00:01:44 --> 00:01:53
Before you start working on the rendering, it is good practice to replace
all materials by a neutral white/gray material that makes it easier
to study and apply lighting.
00:01:54 --> 00:01:57
This can be done in the Render Dialog > Processing tab.
00:01:57 --> 00:02:04
Enable the Material Override option and simply create and apply
a Standard material in that channel.
00:02:11 --> 00:02:16
If you tried rendering the scene now, it comes out as monochromatic,
but still bland.
00:02:17 --> 00:02:23
However, the original materials are preserved and can be restored simply
by disabling Material Override.
00:02:24 --> 00:02:28
Next you will add AO as a Diffuse Map to the override material.
00:02:28 --> 00:02:34
Instead of the Gray diffuse color, choose the
mr Ambient/Reflective Occlusion map.
00:02:34 --> 00:02:37
There are two important parameters to consider:
00:02:38 --> 00:02:47
The Samples value defines the number of rays to be cast from any given
point. 16 is the default. More rays mean better quality but with more
00:02:48 --> 00:02:52
Max distance is the distance the rays travel before they can hit
00:02:52 --> 00:02:55
Set it to 1m for this scene.
00:02:55 --> 00:03:01
Before you render, notice that you added the Ambient Occlusion map
to the Diffuse channel of a Standard material.
00:03:02 --> 00:03:09
Some materials such as Arch & Design have embedded AO channels
in a separate rollout.
00:03:20 --> 00:03:22
Render the scene again to see the improvements.
00:03:22 --> 00:03:33
Notice how much better the details are, especially with the painting
on the wall, the furniture and the door frame on the right.
00:03:44 --> 00:03:51
Increase the Samples value to 32. Notice how the render shows less noise
at the cost of longer render time.
00:03:52 --> 00:04:00
As you can see, this method works by using AO at the material level,
in this case on a single material that overrides all others in the scene.
00:04:01 --> 00:04:07
This means that in a fully textured scene, you'd need to apply AO
on every material.
00:04:07 --> 00:04:11
Short of having a library of AO materials, this can be time-consuming.
00:04:12 --> 00:04:17
Disconnect the AO shader from the Material Override's Diffuse channel.
00:04:17 --> 00:04:22
Next, you explore applying AO to a light rather than to a material.
00:04:22 --> 00:04:29
First you need to add an outside light to simulate the sun, although AO
works in interior lighting conditions as well.
00:04:29 --> 00:04:35
Although you can use AO with advanced lighting, you usually want to use
it with simple lighting setups.
00:04:36 --> 00:04:42
Its whole purpose is to simulate complex lighting scenarios without
the additional calculations.
00:04:42 --> 00:04:46
This is why you will use a simple light here to simulate the sun.
00:04:47 --> 00:04:51
Because of the override material, the windows are now opaque.
00:04:51 --> 00:04:55
With a right-click on the Main toolbar, display the Layers toolbar.
00:04:56 --> 00:05:02
Turn off the 3D-Curtwall_Glaze layer so that the light you create can
enter the apartment.
00:05:05 --> 00:05:08
Create a mr Area Spot to simulate the sun.
00:05:17 --> 00:05:22
Set its angle downward at about 30~45 degrees for a nice afternoon sun.
00:05:22 --> 00:05:30
Alternatively, you can use a Direct light but the mr Area Spot gives
better area shadows in case you decide to use them.
00:05:31 --> 00:05:34
Ensure the light is set to cast RayTraced shadows.
00:05:35 --> 00:05:44
Set its light cone to be fully opened and increase its intensity
to about 3 units.
00:05:46 --> 00:05:51
Render the scene. Notice the total absence of indirect lighting.
00:05:52 --> 00:05:56
You will provide the effect of GI using a single omni light.
00:05:57 --> 00:06:00
Add an Omni light anywhere in the top view.
00:06:00 --> 00:06:07
In the Omni lights Advanced Effects parameters, set the light to only
affect Ambient lighting in the scene.
00:06:08 --> 00:06:11
Set the light intensity to 1 and render the scene.
00:06:13 --> 00:06:17
The results are hardly satisfactory as the scene is now washed out
00:06:18 --> 00:06:22
Expand the mental ray Light Shader rollout and enable that option.
00:06:23 --> 00:06:30
Using the Slate Material Editor, instance the Ambient Occlusion map
and use it as a Light Shader in the omni light.
00:06:31 --> 00:06:37
Other parameters such as light Intensity or Color become irrelevant
as the Light Shader properties take over.
00:06:38 --> 00:06:44
If you need to adjust those values, you do it now
at the Ambient Occlusion Map level.
00:06:48 --> 00:06:54
Render the scene again. Notice the speed at which it renders a much
00:06:55 --> 00:07:03
Now you are using AO as a light shader, which affects ambient lighting
in the whole scene, thereby affecting all materials in that scene.
00:07:05 --> 00:07:11
Remember that this technique is NOT physically accurate. What you lose
in lighting accuracy, you gain in rendering time.
00:07:12 --> 00:07:29
Finally, disable the material override, restore the Glazing layer,
enable the background map and render the scene in full colors and textures.