Graphics Programs Reference
In-Depth Information
Adding Depth of Field
One last item of interest is adding a depth of field (DOF) to the image. This effect adds
blur to the render for the areas of the image that may be out of the lens' focal depth. It
can greatly add to the photo-realism of a rendered image.
Select the renderCam, and open the Attribute Editor. In the Depth of Field heading,
check the Depth of Field attribute. Set Focus Distance to 11, because the box is about 11
units away from the camera, and set F Stop to 9.0. This setting, as with a real lens, sets
how much is in focus around the focal distance. With a higher F Stop value, the focus
runs deeper than with a low F Stop value.
Figure 11.116 shows the final render of the box with DOF enabled. Your render times
will be longer; and for a better render, you'll need to increase your Sample settings.
Figure 11.116 was rendered with Min Samples of 0, Max Samples of 1, and Anti-Aliasing
Contrast of 0.04.
The scene file boxRendering04.ma from the Scenes folder in the Decorative_Box project
will take you to this point.
Notice from the render that the back end of the box is thrown out of focus, along with
the back of the desktop and the walls. Depending on the need and the size of the render,
you'll have to set the sampling levels to suit your needs; but be warned that your render-
ing times will dramatically increase, easily tri-
pling depending on the quality settings. There
are several ways to create DOF in a render
that are faster or more controllable than we've
covered here. You can render out a depth pass
to use with a lens filter in a compositing pack-
age such as Nuke, to keep render times down.
There are also more accurate DOF methods
in mental ray and its lens shaders that you can
experiment with when you've comfortably
grasped the overall workflow presented here.
Finally, adding an Ambient Occlusion
pass isn't absolutely necessary for this render,
although it will enhance the look of the con-
tact shadows.
Figure 11.116
The decorative
box is done!
Wrapping Up the Decorative Box
When you've learned a lot more about lighting and gained confidence with the processes
of lighting, rendering, and compositing, you'll find a wealth of options when you render
in several different layers. For example, if this decorative box were a professional job, its
Search WWH ::




Custom Search