An
issue which is often overlooked or avoided by
individuals new to 3D is the necessity of fine-tuning
projects in conjunction with a compositing package.
Yet the level of interactive flexibility available
within just about any 2D application can save
precious time. While it is possible when working
on full CG projects to render the final image
directly from the 3D rendering engine, this
methodology is rarely utilized in production
environments. Furthermore, as most work in broadcast
and film utilizes 3D imagery as a subservient
element to a live-action backplate, compositing
is going to occur regardless. While many visual
effects shots incorporate 3D, all visual effects
shots are composited. What also must be mentioned
is that there are many effects which not only
benefit from, but require a compositing application's
specialized features: Color correction, film
grain, effects such as depth of field, fog,
glows, motion blur, heat distortion, optical
effects... while some of these can be achieved
in Maya with varying degrees of success, an
experienced compositor with a strong application
can often times take things further.
My
purpose here is to give an overview of how 3D
elements are prepped and rendered from Maya
for use in a compositing pipeline... You will
notice, however, that I do not mention the Render
Layer Manager. Reason is, as you may expect,
that it is clunky and not really the best way
to approach passes/layers.
Passes
While
it is possible for an image rendered with Maya
to achieve the results you need, the most common
pipeline involves getting things are close as
possible in Maya while keeping in mind what
types of tweaks can be more easily made in a
compositing package. Any serious lighter should
be familiar with at least one application. This
includes Nothing Real Shake, Adobe After Effects,
Discreet Combustion, Silicon Grail Rayz and
others.
Diffuse/Beauty
Pass - rendered by turning off 'emit specular'
on all lights.
Specular/Highlight
Pass - rendered by turning off 'emit diffuse'
on all lights.
note:
either Diffuse or Specular passes can even be
rendered on a light by light basis to increase
the degree of post-control. This is should not
be necessary very often, although it is not
uncommon in film.
Reflection
Pass - Create a chrome shader (blinn,
color=black, diffuse=0, specular = white,
reflectivity = 1) and assign it to the object(s)
being rendered. Reflection intensity/opacity/blurring
can then be handled at the compositing stage.
The objects being reflected will need to be
matted out by rendering another matte pass.
Matte
Pass - If an occlusion matte is needed,
the occluding object's shader can be edited
so that it's function in the alpha channel
is to block out objects behind. This is done
by setting the Opacity Control on a Shader
to 'Black Hole'.
Shadow
Pass - There are two types of shadows
when rendering passes. The shadows an object
casts onto itself (self-shadows) and the shadows
the object casts onto other objects (cast-shadows).
Usually just the shadows being cast on other
objects are rendered as a pass, and the self-shadowing
is included in the beauty pass. To render
a shadow pass, turn off 'primary visibility'
on the object's shape node, but leave 'casts
shadows' on. One can also assign the 'Use
Background' Shader to objects receiving the
shadows so that only the shadow is rendered
(to the alpha channel).
The
issue of shadow accuracy on a 'hard - soft'
scale can be dealt with in two ways. One is
to use d-map shadows for self-shadowing which
easily creates varying softness, but then render
hard accurate shadows for cast-shadows so that
complete control is taken at the compositing
stage. It is easy to soften a hard shadow via
gradient blurs, but you can not harden a soft
shadow. The other technique is to try to get
Maya to render accurate soft shadows but this
can slow down rendering. If softening the shadows
in post is going to be too arduous, then this
will be the best route: it is always a question
of which method is faster. At film houses it
is very common to provide hard-edged but accurate
shadows to the compositor so that all blurring/opacity/color
correction can be handled in post.
Effects
Pass - Elements such as fur, smoke, rain,
etc are usually rendered as separate passes.
Depth
Pass - Z-depth can be rendered as a separate
pass to allow for a variety of results in
post. One can use Z-depth to add depth-of-field
and fog to an element. It can also be used
to allow a compositing package to know where
one object on a layer is in relation to another
object on another layer. Therefore if you
had a sphere in the middle of a torus where
some of the sphere is behind and some in front
of the torus, you could render the objects
separately and still composite them successfully.
Z-depth
is a single channel image, being limited to
256 shades of gray in a standard 8-bit/channel
image. It is common to render a depth pass as
a 16-bit image to increase the value range and
accuracy within a z-depth image.
The
gray values within a depth pass represent distance
from the camera where white is near and black
is far. The range in Maya units that this represents
is based on the rendered camera's clipping planes.
Therefore you can increase accuracy by using
near/far clipping planes which are as close
to the objects in your scene as possible while
not clipping them off. It is very important,
however, to use the same clipping plane values
for each rendered layer.
Layers
While
pass rendering allows you to improve the realism
of an image, rendering objects in layers allows
you to tweak objects independantly of each other.
It also allows you to more efficiently manage
render time. If a camera is locked down, for
example, the background could be rendered as
a still image with the animated elements composited
on top.

To
render objects separately, there are a couple
techniques you can use. Managing the 'primary
visibility' attribute via the Attribute Spread
sheet is the most straight forward approach.
You can also use either scene layers or Maya's
render-layer manager, but I prefer to rely on
scene layers. Just be careful when rendering
layers via visibility to watch out for how those
objects interact with each in regards to shadows
and lighting.
Conclusion
So
at this point it should be clear that once you
combine rendering in layers with passes, a shot
can easily be broken down into many elements.
If separate light passes are also rendered,
then the amount of elements can reach high numbers...
so if you have heard case studies from films
such as Final Fintasy or Titanic, where scenes
sometimes have dozens to hundreds of composited
elements per shot, hopefully this overview has
given a clearer picture as to why there are
so many.