■ Setting Up Your Scene for Displacement 319
Rendering Errors on Seams in Older Versions of Maya
In Maya 2008, a change was made to the approximation method, which converts surfaces to a
CCMesh instead of the original method of using subdivision surfaces. The advantage of CCMesh
primitives is the ability to work with arbitrary edges while subdivision surfaces are limited to tri-
angles and quads. Traditional quad layouts are still nevertheless recommended.
Although this new approach is faster, it can create seams in displaced renders with versions of
Maya 2008 previous to SP1. While this has been corrected in Maya 2009 and later, I am including
the fi x here for those of you who are using earlier versions of Maya. To correct this, you will need to
enter some Maya Embedded Language (MEL) in the command line at the bottom lef t of the screen:
addAttr-ln“miExportCCMesh”-atboolmentalraySubdivApprox1;
Be sure the approximation node matches the one in your scene. To set a MEL button for this
command, enter the text into the Script Editor, then highlight the text and middle-mouse-button
(MMB)-drag it to the shelf. Maya will create a button that will execute this line of code when
clicked. If you have only created a single subdivision approximation in your scene, it will work fi ne.
Maya also changed the default method of alpha detection, which when left unchanged can
cause bloated renders.
To change the luminance settings, choose Window → Settings And Preferences →
Preferences, and select Rendering. Change the preferred renderer to mental ray and check the
box marked Use Maya-Style Alpha Detection On File Textures.
On the DVD, you will fi nd a script that automates the conversion of all Subdivision-
Approximation nodes in a scene as well as changes in the Alpha as Luminance values. Follow the
same process of MMB-dragging the script to the shelf to create a button for future use. The fi le is
named ccMeshFixScript.mel.
- In the fi le node, you’ll add the displacement map. The File Node options should open
automatically in the Attribute Editor when you click the File button; if not, double-
click the fi le node in the Hypershade. The File Node options will be visible now in the
Attribute Editor. Click the folder next to the image name to browse to the displacement
map. You may also want to turn off fi ltering at the top of the screen for the fi le node. It
defaults to Gaussian, and in some rare instances this may cause artifacts. When using
ZBrush maps for displacement or bump, it is a good idea to turn off this fi ltering if
you get unexpected results from your rendered surface. If you point the fi le node to the
displacement map in TIF format, Maya will present you with a warning that it cannot
display a preview of the map. This is not a problem and can be ignored. Maya will be
converting the TIF fi le to MAP at render time and the preview swatch is not required
for the shader to work.
- I fi nd it benefi cial to set up a single spotlight or direction light raking across the sur-
face of the model to help spot details that tend to be lost in fl at lighting. If you have
a comparison image, try to approximate the same lighting setup in Maya as you had
with the single light in ZBrush. It is also helpful to lighten the color of your shader to
be closer to the surface color of the model in your comparison image.