Blog Archives
nVidia iray in Maya 2014 *update: iray layered material (MDL)*
**Update** mental ray 3.13 is scheduled to include MDL natively, meaning using mia_materials or the Max version of the Layered Material will no longer be necessary.
If you are curious how to run iray in Maya 2014, you can follow similar steps found in the GPU Ambient Occlusion post. However you need to add some files to those copied into the created directory. Similar requirements from the iray in Maya 2013 post still apply as well as an important samples workaround I will explain later in this post. A more complete set of steps follows here: (you can find information on the layered material at the bottom of this post)
How do I set iray up in 2014?
You will need the libraries for iray that are included with licensed copies of 3ds Max 2014 or mental ray Standalone.
Special note: for OSX and Linux users you need to install the CUDA driver separately Also note that as time passes since the publish of this article, we usually recommend you go with a recent build of whatever drivers you may want to use. And important to realize that older/newer generations of NVIDIA hardware may not be supported since the time of this post.
There are two main steps:
- Move the necessary files to a better location (only has to be done once for the machine)
- Setup the String Options (once per scene using .mel)
Moving the files from your copies of Max or Standalone:
The files you want are:
- cudart64_42_9.dll
- libiray.dll
- libiraymr.dll
1. Copy the files to a new directory you create in your user Maya folder. For example, create a folder called: mental ray The new path would be something like this: C:\Users\UserName\Documents\maya\2014-x64\mentalray
2. Copy the above .dll files to that directory.
3. Go up one directory and find the Maya.env file. Open it with a text editor and put this text in it and save:
MI_LIBRARY_PATH = $MAYA_APP_DIR/2014-x64/mentalray
PATH = $MI_LIBRARY_PATH;$PATH
Ok you’re done with that part and that should work from here on out regardless of scene. Now, open Maya and create a very simple scene.
Creating the String Options
Now you need the correct string options to make iray render.
In the string options found in the shipped Maya 2014, you will already find the string options for iray true/false. You will need to change this to “true” or “on” to work. Below are the other options you might want to add:
select miDefaultOptions;
$idx = `getAttr -size miDefaultOptions.stringOptions`;
setAttr -type "string" miDefaultOptions.stringOptions[$idx].name "progressive min samples";
setAttr -type "string" miDefaultOptions.stringOptions[$idx].value "1";
setAttr -type "string" miDefaultOptions.stringOptions[$idx].type "integer";
$idx = `getAttr -size miDefaultOptions.stringOptions`;
setAttr -type "string" miDefaultOptions.stringOptions[$idx].name "progressive max samples";
setAttr -type "string" miDefaultOptions.stringOptions[$idx].value "1024";
setAttr -type "string" miDefaultOptions.stringOptions[$idx].type "integer";
$idx = `getAttr -size miDefaultOptions.stringOptions`;
setAttr -type "string" miDefaultOptions.stringOptions[$idx].name "progressive max time";
setAttr -type "string" miDefaultOptions.stringOptions[$idx].value "0";
setAttr -type "string" miDefaultOptions.stringOptions[$idx].type "integer";
$idx = `getAttr -size miDefaultOptions.stringOptions`;
setAttr -type "string" miDefaultOptions.stringOptions[$idx].name "progressive error threshold";
setAttr -type "string" miDefaultOptions.stringOptions[$idx].value "0.05";
setAttr -type "string" miDefaultOptions.stringOptions[$idx].type "scalar";
$idx = `getAttr -size miDefaultOptions.stringOptions`;
setAttr -type "string" miDefaultOptions.stringOptions[$idx].name "iray architectural sampler";
setAttr -type "string" miDefaultOptions.stringOptions[$idx].value "off";
setAttr -type "string" miDefaultOptions.stringOptions[$idx].type "boolean";
$idx = `getAttr -size miDefaultOptions.stringOptions`;
setAttr -type "string" miDefaultOptions.stringOptions[$idx].name "iray caustic sampler";
setAttr -type "string" miDefaultOptions.stringOptions[$idx].value "off";
setAttr -type "string" miDefaultOptions.stringOptions[$idx].type "boolean";
$idx = `getAttr -size miDefaultOptions.stringOptions`;
setAttr -type "string" miDefaultOptions.stringOptions[$idx].name "iray mode";
setAttr -type "string" miDefaultOptions.stringOptions[$idx].value "gpu";
setAttr -type "string" miDefaultOptions.stringOptions[$idx].type "string";
Now the workaround part. . .You’ll notice I added the Progressive Controls. This might be seen as redundant since Maya 2014 includes Unified Sampling which also controls iray sampling.
However, in this version of mental ray for Maya 2014, there is a regression that causes iray to stop refining the image after 100 passes using the Unified Sampling controls. So in this case you need to switch Maya 2014 to a different type of rendering algorithm like Legacy Sampling (this disables the Unified Sampling controls) and use the above controls instead.
For “iray mode” there are three options:
- “gpu” (default)
- “cpu”
- “mixed”
You can substitute these for each other.
I also included options for the Architectural and Caustic Samplers.
The iray Architectural Sampler is used mostly for interior scenes where light may come from small openings. The Architectural Sampler is currently a form of Metropolis Light Transport and may be updated later. You should find scenes with that type of lighting converge much faster than before.
The iray Caustics Sampler is also available for scenes where the effect contributes to the image significantly.
You can find out more about iray features by visiting the blog for the iray developers. It’s found on the link sidebar of this blog.
We are working on ways to get the iray material to work in Maya 2014 as well with some success. However a few bugs in Maya may cause headaches with using the arrays. Stay tuned. . .!
**layered material update**
You can use this with Maya 2014 if you:
A) follow the above directions
B) download the newest package from here: http://blog.irayrender.com/post/5294…in-for-3ds-max (Max 2014)
C) rename the .dll to iray_layered_material.dll
D) Use this .mi file: http://db.tt/Jz67Ua8q
!!! And now a warning: !!!
Maya has a bug (not mental ray, this is MAYA). If you close and re-open a scene, the arrays holding your materials are lost because they are not saved. This means your assigned layers disappear and you have to start over. We don’t have a fix for that yet. Looks like a Maya bug and no current workaround.
Below, rendered in Maya:
iray in Maya 2013
Recently Twitted on the mental ray Twitter feed:
We thought we’d try and make it happen in Maya 2013. With some digging and a license of Standalone; the end result is a complex menagerie: Spinning Buddha!
For Progressive + IPR you need: A new Maya 2013 SP1 re-posted for download on Autodesk’s site: Autodesk – Autodesk Maya Services and Support
So how do you make this happen? (Please note that the magic works for Windows right now. Linux can be found in the comments from Brenton. Haven’t gotten to OSX.)
Well, first you need the correct files. This means you need a licensed copy of either mental ray Standalone or 3ds Max (Or Design) separately or as part of your bundle. You will need these files:
- libiray.dll
- libiraymr.dll
- cudart64_40_17.dll (Possibly slightly different, this is x64)
Place these into a single directory you create, name it whatever you need to make it recognizable. In our example we’ll simply call it: iray
On Windows we placed it here: <My Documents>\maya\2013-x64\iray
You now need to alter the Maya.env file found in the correct folder for 2013. You can find it here: C:\Users\<your user name>\Documents\maya\2013-x64\Maya.env
Open with a plain text editor and add these lines:
MI_LIBRARY_PATH = $MAYA_APP_DIR/2013-x64/iray
PATH = $MI_LIBRARY_PATH;$PATH
Now open Maya and render using the information and hints found on the ARC forum here:
Some short tests confirmed that this works with Progressive IPR in Maya 2013 SP1.