1. #1
    Senior Member User Gallery
    Join Date
    Dec 2003
    Location
    Los Angeles, CA USA
    Posts
    795

    Default 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.
    badRender.jpg

    The second change is to alpha detection. Bloated renders occur because Mental Ray is defaulting to not considering Alpha as luminance.

    bloat.jpg

    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:

    sriptIcon.jpg

    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.

    editor.jpg

    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.

    shelf.jpg

    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
    goodRender.jpg

    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

    Attached Thumbnails Attached Thumbnails Click image for larger version. 

Name:	screen.jpg 
Views:	1366 
Size:	168.8 KB 
ID:	83520  

  2. #2
    Senior Member User Gallery
    Join Date
    Apr 2006
    Age
    40
    Posts
    228

    Default Thanks

    Thanks a bunch for this it will help a ton.

  3. #3
    Senior Member User Gallery
    Join Date
    Sep 2007
    Posts
    184

    Default great!!!!!

    thanks a lot, right now i did my first (good) displace render with sss material.....
    cheers prova.jpg
    Last edited by MRC_O; 02-02-08 at 04:19 PM.

  4. #4
    New Member User Gallery
    Join Date
    Feb 2006
    Posts
    9

    Default

    You are fabulous!!!!
    the seams were always a huge headache for me, and i could never find out what caused them.

    Thanks!

  5. #5

    Default

    Well Done Scott, well done....

  6. #6
    Senior Member User Gallery
    Join Date
    Apr 2006
    Location
    BC Canada
    Posts
    172

    Default

    A do it all in one Mel script makes the process a whole lot easier than doing it manually via the previous 2008 fix method out there.
    Thank you!

  7. #7
    New Member User Gallery
    Join Date
    Sep 2007
    Posts
    3

    Thumbs up Awesome!

    Whoever rated this as a 1 has obviously never touched ZB or MAYA before. Awesome tutorial for an otherwise complicated issue. Displacement seams = huge headache.

  8. #8
    Senior Member User Gallery
    Join Date
    Sep 2007
    Posts
    184

    Default For Scott Spencer

    Hi Scott, Please Could You Tell Me, The "expression String" That You Wrote On Your Videotutorial Under The "alpha Gain Offsett" Node????
    Thank A Lot
    Marco

  9. #9

    Default

    Oooh! Thank you very much! A wonderful all in one script!!

  10. #10
    Senior Member User Gallery
    Join Date
    Dec 2003
    Location
    NY
    Posts
    2,869

    Default

    Many Many thanks, as usual...

    you have no idea how helpful and timely this is!!!!!

  11. #11
    Senior Member User Gallery
    Join Date
    Dec 2003
    Location
    NY
    Posts
    2,869

    Default

    mr co

    = - filenodename.alphaGain / 2;

  12. #12
    Senior Member User Gallery
    Join Date
    Dec 2003
    Location
    Los Angeles, CA USA
    Posts
    795

    Default

    No problem guys, Im glad it helps. I took a LONG time to move to Maya 2008 and when I did I put this together. Figured I would share it here.
    Now I need to update the displacement guide and my Gnomonology tuts.

    Thanks Again!

    S

  13. #13

    Default

    You're awesome Scott! Thanks for sharing the love!

    Ryan

  14. #14
    Senior Member User Gallery
    Join Date
    Mar 2006
    Location
    Waterloo, Ontario. Canada
    Age
    42
    Posts
    402

    Default

    Silly question:

    Is there a version of Multi-Displacement for ZBrush 3.1?

    I have been looking without any luck
    Live every day as though it were your last,
    'cos one of these days... it will be!

  15. #15
    Senior Member User Gallery
    Join Date
    Jun 2007
    Location
    Athens
    Posts
    115

    Default Thank you!

    Thank you so much for that!

    also thanks to marcotronic who spotted the subdivision approximation node bug in the first place.(that was a hard one to find!)

Page 1 of 14 123410 ... LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •