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)

About David

I am a VFX artist that specializes in Lighting and Rendering. I spend a fair amount of my time supplying clients with artistic solutions as well as technology solutions. With a background in fine art and technical animation training, I strive to bridge the divide between the artist and technologist.

Posted on July 5, 2013, in maya and tagged . Bookmark the permalink. 25 Comments.

  1. Great topic, looking forward to see how it goes !

    I would like to have your opinion on something (iray related but not only) if you don’t mind.
    What do you think about the managing of lighting in 3DSMAX ? I’m a Maya user and I wanted to give 3DS a try, and I have to say, I’m impressed by how easy it is. There is IES profile preview inside the viewport ! In real-time ! Just try to have physically correct IES profile in the render view in Maya ..I still don’t know how to do it.

    I know that you guys don’t use the photographic exposure control, but just as an example, in Maya, you have to plug it in every camera you’re using (which is theoretically logical, but practically very irritating ..), and you have to plug weird numbers in some attribute to expect it to work fine, connect tons of nodes, change the gamma in the render settings, or plug a gamma node in every f***ing textures of your scene ..

    In 3DSMAX you just have to click a single button !

    Everything, lighting related, seem to be much more easy to use. And about iray, I just don’t get it, as a Maya user, I feel let down (lol ..) by Autodesk.
    Why just 3DSMAX, I don’t see any reasonable argument to justify that odd choice.

    And if you do mind to answer (which is fine), thanks again for what you do.

    Jack

    • Maya and Max were originally targeted at different industries. Max was traditionally design and architecture with some games. Maya was typically animation and VFX production.

      Maya is a pipeline hub. And as such it was also a more expensive purchase than Max and was aimed at flexibility. In fact, we can hack unexposed features into Maya more easily because of this flexibility. That is part of the nodal workflow where mental ray elements can be added and removed arbitrarily instead of built-in. Houdini takes the nodal workflow a step further and provides even more flexibility.

      However, integration with mental ray is changing in Maya because more customers have demanded it. Previously the larger customers wanted to create their own pipeline around the “hub” concept. But the democratization of animation software and the lowered price means now there are customers without the need of customization in larger numbers. This is where the desire for simplicity comes in with something like a global camera and one-button rendering.

      I can see both sides of that. I am a little concerned that with the move to ultimate simplicity we will lose the flexibility. But studios are hiring inexperienced generalists in higher and higher numbers at lower pay. This means there’s pressure on software companies to make everything as easy as possible.

      This is part of the reason iray and the Material Description Language are around. nVidia realizes fewer companies are interested in this flexibility or the desire to write shaders for a specific look. Instead, everything resides in the core for iray that the user manipulates.

      Now back to Maya being an Animation and VFX-primary product: iray is not currently aimed at that industry. iray is designed for easy and fast architectural and design renderings. Autodesk does see the benefit of iray in Maya and Corey Mogk has mentioned it’s in their roadmap. But in the meantime a company called 0x1 in Germany will beat them to integration.

      • Thanks for taking the time to answer my question.

        Your concerns about the one button policy are completely understandable, and I do agree with that. I also get the idea of the pipeline hub, and thanks to that we can get around issued easily.

        But that’s where I don’t follow you, the community worked on custom render settings to expose the unified sampling method and make it easier to use. And it ended up being in the official Maya 2014 version. I was talking about that kind of “button”. The kind of thing you end up scripting because it’s such a pain to do over and over. And when this thing concerns the majority of users, I think it’s fair to say that it has its place in the software.

        I just think maya is a bit of a mess; the openness is not opposed to the ease of use. I think mental ray is terribly integrated inside maya, and to be honest, this is the reason why your website is in my favs, because you offer great solutions to work around those issues, and allow us to take advantage of the power of mental ray.

        I don’t want a one button software, it goes against any artistic inspiration. But to hassle against your tool isn’t the right thing either imho.

        Anyway, thanks again to share your point of view, and your knowledge.

        Jack

      • Well, that’s a different argument though. That’s the difference between different integration (lens shaders not built-in, color management, etc) and NON-integration (Unified Sampling and iray) Color management for film, for example, is more complex than just in and out of sRGB.

        This blog provides help with both sides of that problem as well as workflow pointers like texture management.

        I suspect over time mental ray integration will begin to merge with our ideas of how it should be integrated. Maya 2014 already adopted large portions of the community UI and defaults. But at the same time we have to keep an eye on how to do that and allow studios with their own pipeline a way to manipulate or integrate the change.

    • Hi,

      Proceed as above, but got the error after while rendering in maya 2014 on GPU.
      Any idea ? push that to arc forum ?

      _________________ log

      PHEN 0.3 21 MB info : ———————————————–
      PHEN 0.3 21 MB info : mayabase version 10.8, compiled on Jul 17 2013.
      PHEN 0.3 21 MB info : ———————————————–
      RC 0.28 21 MB info : progressive: deactivating subsampling for iray renderer
      RC 0.28 21 MB info : progressive: using iray renderer
      IRAY 0.28 32 MB info : found 2 CUDA devices
      IRAY 0.28 32 MB info : default to using all CUDA capable devices
      IRAY 0.36 32 MB info : using baked environment
      PHEN 0.36 40 MB warn : maya_state(): Called on an unexpected ray.
      IRAY 0.36 40 MB info : converted scene in 0.136s
      IRAY 0.36 40 MB warn : found more than 1 color buffers
      IRAY 0.36 40 MB warn : discarding buffer 1 (“L.*E”)
      IRAY 0.71 44 MB info : Using batch scheduling, architectural sampler disabled, caustic sampler disabled
      IRAY 0.104 44 MB error: CUDA device 0: cannot get memory statistics
      IRAY 0.104 44 MB error: CUDA device 0: cannot get memory statistics
      IRAY 0.71 44 MB error: CUDA device 0 (Quadro 7000): unknown error (Failed to get function attributes)
      IRAY 0.71 44 MB error: CUDA device 0 (Quadro 7000): unknown error (while allocating host mapped memory buffer)
      IRAY 0.71 44 MB error: CUDA device 0 (Quadro 7000): device cannot be used as it does not support mapped memory (canMapHostMemory)
      IRAY 0.71 44 MB error: CUDA device 0 (Quadro 7000): Device initialization failed, will not be used
      IRAY 0.105 44 MB error: CUDA device 1: cannot get memory statistics
      IRAY 0.105 44 MB error: CUDA device 1: cannot get memory statistics
      IRAY 0.71 44 MB error: CUDA device 1 (Quadro 7000): unknown error (Failed to get function attributes)
      IRAY 0.71 44 MB error: CUDA device 1 (Quadro 7000): unknown error (while allocating host mapped memory buffer)
      IRAY 0.71 44 MB error: CUDA device 1 (Quadro 7000): device cannot be used as it does not support mapped memory (canMapHostMemory)
      IRAY 0.71 44 MB error: CUDA device 1 (Quadro 7000): Device initialization failed, will not be used
      IRAY 0.71 44 MB error: All devices failed to initialize

  2. Hi David,

    Really intrigued about getting iray on the go in Maya. I note you say the iray materials are a bit buggy? Is it worth experimenting with iray and say the old mia_materials/mip_matte shadow. i.e do this work with iray and to what extent? Or is it best to try out the new mila shaders or just wait till things get a bit better figured out with the iray materials?

    Thanks

    James

    • The iray materials work fine, but as I pointed out above, it’s a bug with Maya where the layer arrays are not saved. Meaning a re-opened scene needs to be rebuilt. Until there’s a fix for Maya, I wouldn’t recommend major projects with the layered material.

  3. Amazing topic! thank you very much.

    Is there anywhere were we can get something like the “MentalRay 3.9 native integration”?
    http://www.creativecrash.com/maya/script/mentalray-3-9-native-integration
    That’s an amazing Maya Script but unfortunately doesn’t work under 2014.

    Meanwhile I created myself a iRay shelf so I can switch it on and off and play with some basic parameters;
    https://dl.dropboxusercontent.com/u/4622621/shelf_iRay.zip
    I know is not much but is better than nothing 😛

    Thanks again,

    Alex

  4. Hi David,

    When you wrote “C) rename the .dll to iray_layered_material.dll” which .dll do you mean. I’m a little unsure at this point…Also do I have to also add environmental variable besides just the Maya.env file?…

    I’m using Maya 2014 Extension SP1…TIA…

    Steven

  5. So, I’m a little curious about setting this up on the mac. I’ve followed the directions, and I’ve enabled the string options in miDefaultSettings. However, how do I know that it’s working? Am I supposed to see iRay as a renderer option, or do I just select mental ray? Can I use the normal mental ray materials and lights? I have to Quadro 4000s in my Mac Pro, and want to compare render times using those with iRay to Mental Ray via CPU.

    • No, this isn’t operating as a plugin in Maya so you won’t see menu changes at all. You will render by choosing “mental ray”

      For most things, mental ray will be much faster than iray. iray is a simple push button solution that is doing more of a physical simulation than mental ray. This means it’s more automatic but typically slower.

  6. Hi guys,

    Im just trying to get this work properly, but Im stocked.

    Where i suppose to copy the ” iray_layered_material.dll” file? In wich directory?
    In the directory we created?

    And for the point D.

    D) Use this .mi file: http://db.tt/Jz67Ua8q
    This should also copied into the folder created at the beginning of this tutorial?

    Thank you guys!

  7. Hi
    I have a problem i want to see the used GPU ( i have two Quadro K6000 ) Cards in my Maya Output Folder i need to know the Iray use my card or not, but the only thing i see in the output Window is this:

    mental ray for Maya 2014
    mental ray: version 3.11.1.13, Sep 12 2013, revision 204885
    [2014/Jun/18|18:07:21] V-Ray: V-Ray for Maya version 2.40.02 from May 14 2014, 16:40:13
    [2014/Jun/18|18:07:21] V-Ray: V-Ray core version is 2.00.02
    PHEN 0.36 199 MB warn : maya_state(): Called on an unexpected ray.
    IRAY 0.36 199 MB warn : found more than 1 color buffers
    IRAY 0.36 199 MB warn : discarding buffer 1 (“L.*E”)
    PHEN 0.36 200 MB warn : maya_state(): Called on an unexpected ray.
    IRAY 0.36 200 MB warn : found more than 1 color buffers
    IRAY 0.36 200 MB warn : discarding buffer 1 (“L.*E”)
    PHEN 0.36 210 MB warn : maya_state(): Called on an unexpected ray.
    IRAY 0.36 210 MB warn : found more than 1 color buffers
    IRAY 0.36 210 MB warn : discarding buffer 1 (“L.*E”)
    PHEN 0.36 204 MB warn : maya_state(): Called on an unexpected ray.
    IRAY 0.36 204 MB warn : found more than 1 color buffers
    IRAY 0.36 204 MB warn : discarding buffer 1 (“L.*E”)
    IRAY 0.36 209 MB warn : found more than 1 color buffers
    IRAY 0.36 209 MB warn : discarding buffer 1 (“L.*E”)
    IRAY 0.36 214 MB warn : found more than 1 color buffers
    IRAY 0.36 214 MB warn : discarding buffer 1 (“L.*E”)
    IRAY 0.36 214 MB warn : found more than 1 color buffers
    IRAY 0.36 214 MB warn : discarding buffer 1 (“L.*E”)
    IRAY 0.36 212 MB warn : found more than 1 color buffers
    IRAY 0.36 212 MB warn : discarding buffer 1 (“L.*E”)
    IRAY 0.36 206 MB warn : found more than 1 color buffers
    IRAY 0.36 206 MB warn : discarding buffer 1 (“L.*E”)
    IRAY 0.36 209 MB warn : found more than 1 color buffers
    IRAY 0.36 209 MB warn : discarding buffer 1 (“L.*E”)
    IRAY 0.36 216 MB warn : found more than 1 color buffers
    ….. and so on

    Do you know why i cant see whether my card will be used or not ?

    thanks in advance

    • Further up in the post there’s a link to the ARC forum on how to best prepare your scene for rendering in iray. One of those things is not exporting the Maya state shader, that’s what you see complaining in the output log. This might interfere with rendering. You might also want to check out iray for Maya from [0x1]

  8. Hi,
    I’m trying iray in maya 2015. It seems to work fine but i’m not impressed by its performance. I have a gtx titan black and I get this warn in the output window: “device optimized for interactive usage; performance could be sacrificed”. Do you know if there is a specific string option to deactivate interactive usage? Thanks

    • Iray has different modes but interactive mode is not exposed in Maya yet (would have to be through Iray for Maya anyway) Iray is also a physical simulation of light transport. This means it will be slower than other techniques you’ve probably used. But for the amount of work it’s doing to be automatic lighting, it’s actually pretty fast.

      It may be warning that the card you’re using or the driver is set to a different performance threshold and not compute performance. But that’s a guess since I don’t have that card.

  1. Pingback: Setting Up nVidia iRay in Maya 2014

  2. Pingback: iray hardware benchmarks | elemental ray

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: