Mental ray standalone 3.8.1 iray for Maya 2011

Even though the name sounds like an Apple product but it is not!
First I like to give credit for Ryan Brady for starting this thread on cgtalk.
In my sample file I used mental ray DOF , IBL and FG.


Render time 17:23 min

In order to incorporate the iray function in your favorite 3d app, you will need to have an installed copy of mental ray Standalone 2011.
I have been using Maya in my tests so here is an example of what I’ve done.

Copy the following 3 .dll files
cudart.dll
libiraymr.dll
libiray.dll
From: C:\Program Files\Autodesk\mrstand3.8.1-adsk2011\bin
To: C:\Program Files\Autodesk\Maya2011\bin

To get iray to appear in our render options, you will need to use the following MEL script
(You will require at least one render with mental ray in order to get the midefaultoption node to appear in your scene.)

setAttr -type "string" miDefaultOptions.stringOptions[28].name "iray";
setAttr -type "string" miDefaultOptions.stringOptions[28].value "on";
setAttr -type "string" miDefaultOptions.stringOptions[28].type "boolean";

Note:   Since iray is not currently supported with Maya, you want to make sure that you only use mental ray nodes, this way the engine can render them without giving any errors.
For the example, the IBL node is not currently supported, instead I used the mib_lookup in the camera environment slot.
For DOF I used mental ray physical lens Shader:

In the Shader SG node, turn On Suppress all Maya Shaders and turn Off Export with shading Engine.

If I would to render as is, my render would come something like this:


Render time 2:29 min

In order to control the quality of the render, you would also need to enable the progressive rendering:

setAttr -type “string” miDefaultOptions.stringOptions[34].name “progressive”;
setAttr -type “string” miDefaultOptions.stringOptions[34].type “boolean”;
setAttr -type “string” miDefaultOptions.stringOptions[34].value “on”;

setAttr -type “string” miDefaultOptions.stringOptions[35].name “progressive subsampling size”;
setAttr -type “string” miDefaultOptions.stringOptions[35].type “integer”;
setAttr -type “string” miDefaultOptions.stringOptions[35].value “1″;

setAttr -type “string” miDefaultOptions.stringOptions[36].name “progressive subsampling mode”;
setAttr -type “string” miDefaultOptions.stringOptions[36].type “string”;
setAttr -type “string” miDefaultOptions.stringOptions[36].value “sparse”;

setAttr -type “string” miDefaultOptions.stringOptions[37].name “progressive subsampling pattern”;
setAttr -type “string” miDefaultOptions.stringOptions[37].type “string”;
setAttr -type “string” miDefaultOptions.stringOptions[37].value “linear”;

setAttr -type “string” miDefaultOptions.stringOptions[38].name “progressive min samples”;
setAttr -type “string” miDefaultOptions.stringOptions[38].type “integer”;
setAttr -type “string” miDefaultOptions.stringOptions[38].value “4″;

setAttr -type “string” miDefaultOptions.stringOptions[39].name “progressive max samples”;
setAttr -type “string” miDefaultOptions.stringOptions[39].type “integer”;
setAttr -type “string” miDefaultOptions.stringOptions[39].value “100″;

setAttr -type “string” miDefaultOptions.stringOptions[40].name “progressive max time”;
setAttr -type “string” miDefaultOptions.stringOptions[40].type “integer”;
setAttr -type “string” miDefaultOptions.stringOptions[40].value “0″;

setAttr -type “string” miDefaultOptions.stringOptions[44].name “progressive error threshold”;
setAttr -type “string” miDefaultOptions.stringOptions[41].type “float”;
setAttr -type “string” miDefaultOptions.stringOptions[41].value “0.0130″;

setAttr -type “string” miDefaultOptions.stringOptions[42].name “progressive occlusion cache points”;
setAttr -type “string” miDefaultOptions.stringOptions[42].type “integer”;
setAttr -type “string” miDefaultOptions.stringOptions[42].value “0″;

setAttr -type “string” miDefaultOptions.stringOptions[43].name “progressive occlusion cache rays”;
setAttr -type “string” miDefaultOptions.stringOptions[43].type “integer”;
setAttr -type “string” miDefaultOptions.stringOptions[43].value “128″;

setAttr -type “string” miDefaultOptions.stringOptions[44].name “progressive occlusion cache max frame”;
setAttr -type “string” miDefaultOptions.stringOptions[44].type “integer”;
setAttr -type “string” miDefaultOptions.stringOptions[44].value “32″;

setAttr -type “string” miDefaultOptions.stringOptions[45].name “progressive occlusion cache exclude”;
setAttr -type “string” miDefaultOptions.stringOptions[45].type “integer”;
setAttr -type “string” miDefaultOptions.stringOptions[45].value “0″;

For more info regarding progressive rendering, please refer to Matteo Magnazzi blog.

Now we can control the quality by changing the render time:

Note:   To confirm that the iray is active you should see the following message in your output window

RC 0.10 info : progressive: using iray renderer
IRAY 0.10 info : loading iray rendering plugin from C:\Program Files\Autodesk\Maya2011\bin\\libiray.dll
IRAY 0.10 info : loading iray integration plugin from C:\Program Files\Autodesk\Maya2011\bin\\libiraymr.dll
IRAY 0.10 info : found 1 CUDA devices
IRAY 0.10 info : defaulting to use all CUDA devices


Render time 5:31 min

Going with higher settings:


Render time 10 min

Final thoughts:
iray is still beta and not intended to be used with Maya yet, so expect lots of crashes and the occasional freeze.

If you get black render, rename or nvcuda.dll in C:\Windows\System32.
Restart and try again.

Recent Entries

17 Responses to “Mental ray standalone 3.8.1 iray for Maya 2011”

  1. Alex Pummer Says:

    The mel commands to get the MiDefaultOption is as follows..
    —-=Begin:MEL=——————–
    if (`objExists mentalrayGlobals` == 0) {miCreateGlobalsNode;} else print “mentalGlobals already created”;
    if (`objExists miDefaultOptions` == 0) {miCreateDefaultNodes;} else print “miDefaultOptions already created”
    —–=End:MEL=———————

    I needed to track this info down as I created a script that would setup the contour rendering. But would also run into the problem that the miDefaultFramebuffer would not exist, its created along with miDefaultOptions. Took me a little bit to track it down in the default Maya mel scripts. Hope it helps.

  2. David Says:

    I get a side-effect of: “If you get black render, rename or nvcuda.dll in C:\Windows\System32.”

    I renamed it, but now iRay cannot find a CUDA device and renders with the CPUs. With the file available I get a CUDA device but a black render.:-(

  3. Ashraf Says:

    Does your card support cuda? check with nvidia and make sure you have the latest driver.

  4. David Says:

    It’s a Quadro FX 1700. And I have the latest drivers, also ran the CUDA developer drivers. Same result. It works fine with standalone and piping to imf_disp and the file intact but not from inside Maya unless CPU mode only.

  5. Paolo Says:

    I also have a quadro fx1700 and I get black renders in gpu mode. I didn’t get what you mean with “rename or nvcuda.dll in C:\Windows\System32″. I have nvcuda.dll in my windows\system32 folder but to which name should I rename the file? Thank you.

  6. Mark Says:

    Hi. Iray work on my computer – x64 and x86 OS ;) When scene is black, change background color and add material for object ;)

  7. Felipe Says:

    I folow the instructons but don’t work. Tis is my Output Window:

    mental ray: got 8 satellite CPUs.
    IRAY 0.7 warn : ignoring unsupported shader maya_lambert

    I have nvcuda.dll in my windows\system32 folder. Create Maya scene >> export to .mi file >> render with Standalone. this is what i found in mentalImages thread http://forum.mentalimages.com/showthread.php?t=6584 . How i render with standalone or how i can do it work in maya? Thank you.

  8. Ashraf Says:

    iray doesn’t understand Maya Shaders.
    have another read > specially on this part
    turn On Suppress all Maya Shaders and turn Off Export with shading Engine.

  9. JR Says:

    Hi, I have a Quadro FX 580, CUDA supported, etc… but doesn’t works… With Black Render, this is my output windows…

    PHEN 0.6 info : ———————————————–
    PHEN 0.6 info : mayabase version 10.8, compiled on Jul 13 2010.
    PHEN 0.6 info : ———————————————–
    IRAY 0.3 info : found 1 CUDA devices
    IRAY 0.3 info : defaulting to use all CUDA devices
    PHEN 0.5 warn : maya_state(): Called on an unexpected ray.
    RC 0.3 progr: progressive: finished (sub)frame 1 in 0.03704 seconds
    RC 0.3 progr: progressive: finished (sub)frame 2 in 0.02520 seconds
    RC 0.3 progr: progressive: finished (sub)frame 3 in 0.03073 seconds
    RC 0.3 progr: progressive: finished (sub)frame 4 in 0.02796 seconds
    RC 0.3 progr: progressive: finished (sub)frame 5 in 0.02199 seconds
    RC 0.3 info : iray: desired quality reached – stopping
    RC 0.3 info : progressive: total rendering time was 0.14 seconds
    RC 0.3 info : progressive: average frame time was 0.03 seconds
    RC 0.3 info : progressive: sending finished rectangles to disp.
    PHEN 0.3 progr: calling output shaders
    PHEN 0.3 progr: maya_shaderglow(): Computing glow…
    PHEN 0.3 info : maya_shaderglow(): Glow: Filter Width …. 21
    PHEN 0.3 info : maya_shaderglow(): Resolution …… 0.638926
    PHEN 0.3 info : maya_shaderglow(): Normalization … 0.882000
    PHEN 0.3 info : maya_shaderglow(): Halo: Filter Width …. 51
    PHEN 0.3 info : maya_shaderglow(): Resolution …… 0.260841
    PHEN 0.3 info : maya_shaderglow(): Normalization … 5.202000
    PHEN 0.3 progr: maya_shaderglow(): Done!
    PHEN 0.3 progr: writing image file H:/maya/containers/images/tmp/irayTest.iff (frame 1)
    RC 0.3 progr: rendering finished

    Any ideas??

    I working the Scene with Mentalray shaders (mia_material and mia_materia_X) for lighting a Physical Sun and Sky.

  10. Ashraf Says:

    iray doesn’t support sun/sky nor IBL .. at least for now .

  11. JR Says:

    Ok, I change the light and use the same you but only get a BLACK Render….
    Can you make a little screen capture VIDEO process from your screen?… thanks

  12. shangu Says:

    HDR and physical sky and sun both work.
    just use environement shader to plug HDR.

  13. Mark Says:

    Hi Ashraf,
    I’m also interested in cuda rendering… Do you have any performance data showing the difference between CPU vs. GPU rendering for your example ?
    Thx
    Mark

  14. edgar Says:

    waaaaaaaaaaa rename the nvcuda.dll in windows system32 it fix the black render

  15. edgar Says:

    hi , if i active the irradiance particles and i have a crash , i just active in render render settings-options-diagnose bsp- size, i have the bsp2 and the version 64 bits for maya 2011

  16. majid Says:

    hello , I need program Mental ray standalone 3.8.1 iray.

    please give me pleeeeeeeeeeeeease . i Not mony

  17. Cars Auctions Says:

    Hey! This is kind of off topic but I need some advice from an established blog. Is it very difficult to set up your own blog? I’m not very techincal but I can figure things out pretty quick. I’m thinking about setting up my own but I’m not sure where to begin. Do you have any tips or suggestions? Thank you

Leave a Reply