Monthly Archives: July 2013

[0x1] iRay integration in Maya

For those of you thirsting for a true integration of iRay in Maya, take a look here: [0x1] Software

Keep an eye out if you’re visiting SIGGRAPH. . .

[0x1] iRay Integration using MDL

nVidia User Group Meeting – SIGGRAPH 2013

At this year’s SIGGRAPH there will be an official user group meeting at the Hilton Anaheim Mix Lounge.

Tuesday, July 23rd 

6pm to 8pm

There will be drinks. 🙂

nvidia-logo

nVidia and mental ray

When mental images was purchased by nVidia, one of the main questions was “Why?” After all, nVidia is a hardware company whose technology helps sell and enhance their own products.

Beyond just the technology patents, there are plans beyond what you have already seen:

nVidia iray in Maya 2014 *update: iray layered material (MDL)*

iray Mixer

iray Mixer

 

**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:

  1. Move the necessary files to a better location (only has to be done once for the machine)
  2. 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 2014 with Layered Material (MDL)

iray in Maya 2014 with Layered Material (MDL)