7 Attachment(s)
Rendering successful displacement in Maya 2008
Maya 2008 Displacements
It appears that a lot of people are having problems with Maya 2008 and rendering displacement maps. Two major changes have been made in Maya 2008 that impacts the ability to effectively render 32 bit displacement maps.
I did some reasearch and set up a mel script that will set up the scene file correctly. Thanks must go to those who found the problems with Maya 2008 early on. ZBC member marcotronic uncovered the CCMesh change.
The changes that Autodesk made are to the Alpha Detection and the mental Ray export mesh at render time. Maya 8.5 and earlier use Subdivision Surfaces at render time when a subdivision approximation node is assigned. Maya 2008 defaults to the CCMesh or Catmull Clark mesh. This is intended to be faster and support tris, ngons, and quads. The problem is it creates seams in the render.
The second change is to alpha detection. Bloated renders occur because Mental Ray is defaulting to not considering Alpha as luminance.
You can set this manually on each file node or change the default setting under Window>Settings and Preferences>Rendering Use maya style alpha detection.
The script I am posting will throw this switch for the scene file returning it to Maya style alpha detection.
Setting up the script
This is a simple process. We will just copy and paste the script into the script editor and create a MEL shelf button for it. First off open the script editor:
Copy and paste the text of the script from the end of this post into the bottom window of the script editor. Highlight all the text by pressing Control A.
Then using the Middle Mouse Button click and drag the text up to the shelf. If you dont see the shelf just press Control and Spacebar to show all the menu elements.
Now this button will execute the MEL script when pressed. Just set up you renders as normal and then press this button before rendering. It will make all the changes. You only need to do this once if you save your scene file. It will also support multiple subdivision approximations in a single scene. The script will select and convert each of them.
Make sure to save your preferences so the shelf button stays between Maya sessions. Save prefs with File>Save Preferences
A successful render after running the miSetupScript
I hope this helps. My thanks to everyone who has shared their experience and fixes on the forum especially marcotronic; who uncovered the new CCMesh primitive on the Autodesk site.
Scott
//COPY THE SCRIPT FROM HERE
// mental ray Subdivision Approximation script
// by scott spencer
//scott@scottspencer.com
//converts all subdivision approximation nodes in the scene from CCMesh to subdivision surface as well as sets the option
// to use maya style alpha detection
optionVar -iv "miUseMayaAlphaDetection" 1 -sv 1 1; //sets maya style alpha detection - mthe same as
// checking the Alpha is Luminance box in the file node but this works for all displacements in the scene
string $selected[] = `ls -type mentalraySubdivApprox`; // selects each subdivision approximation node in the scene and adds to an arry
int $size = `size ($selected)`; // creates the counter variable
for ($a=0;$a<$size;$a++) //increments thru the array
{//beginning of loop
string $name = $selected[$a]; // this variable accesses each element of select using $a as an index
addAttr -ln "miExportCCMesh" -at bool $selected[$a];
}
//END OF SCRIPT