The iray cometh


A guy at work and I got to messing around with iray in maya 2011 and max 2011. We were able to get both working with little effort. All you need is to take the dlls from the bin folder of mentalray standalone to the bin file of maya. Then flip it on with a string option.

I also replaced all the mi and dlls from the shaders(standalone) to the mental ray(mayamr) folders. Not sure you need to do that but I did for good measure.

Its a little funny to work with. They did fix the alpha issue form the beta. I am still running out of memory a lot (to be expected) but I will post images in a bit.

Ryan Brady


Here is image #1. It rendered in 60sec. I don’t have my hosting info so I have to attach. Sorry about horrible jpg. If you cant tell it looks pretty good but its still a bit grainy. I will post more later.


Keep’em coming Ryan.

By the way, are you rendering in CPU, or GPU?


is it unbiased renderer? I have been testing out Octane (an unbiased CUDA renderer) and it’s pretty great, even in it’s beta state. Some tests:


If anyone else is playing with this, here is the post I saw on the mental ray beta. Its a little out of date but gives you an idea of how to build an iray scene.

Here is a little tutorial how to adjust your scene inside Maya and tune export options, so that the final .mi file can be used successfully with Standalone in iray rendering mode.

Maya manipulate scene for iray


A Maya scene can be tuned to use only a small subset of shaders and effects which is supported by iray. Different versions of iray handle certain shaders differently. For example, the Maya shadingNode (also known as Shading Engine) may be properly detected and skipped by iray, or, iray shader mapping will crash.

Prepare Scene for iray

The iray shader mapping supports a list of shaders, see release notes for recent status.

Currently suggested shaders are:
mia_material, mia_material_x as material surface shader, disable Multiple Outputs
Maya file node, or mental ray base shaders, for texture image lookup
mia_exposure_photographic as camera lens shader
mia_physical_sky as camera environment shader
physical_lens_dof as camera lens shader

Export .mi File for iray

In order to create a .mi file for rendering with mental ray Standalone, please follow the following guidance to export .mi file without Maya specifics.

Maya export .mi files without Maya specifics


1 Introduction
2 To create non-Maya specific scenes
3 Tune global translation options
4 Tune file export options
5 Tweak exported .mi file


Sometimes it is desired to create scenes which just contain mental ray shaders, like those from architectural, base, paint, physics, and subsurface libraries, and no shaders from Adsk or mayabase packages. Using just those shaders is possible, but upon export to an .mi file there is lots of other custom Maya stuff included. To get rid of this the following steps need to be performed (manually or per script).

To create non-Maya specific scenes
Do not use native Maya material shaders
Assign materials from Lighting/Shading / Assign New Material menu in the bottom section only
After assignment, the Attribute Editor (AE) opens for the shadingGroup (SG) node
In Custom Shaders section
Suppress all Maya Shaders on
Export with Shading Engine off
Export with Volume Sampler off
Do not enable certain Maya visual effects
Depth Of Field (Camera / Depth of Field), instead attach mental ray lens shader in the camera
Image-Based Lighting (Render Settings / Indirect Lighting / Image-Based Lighting), instead attach environment shader in the camera, or use Physical Sun and Sky

Tune global translation options

In Render Settings (Window / Rendering Editors / Render Settings)
Common / Render Options section
Enable Default Light off
Options / Translation section
Export Particles off
Export Particle Instances off
Export Fluids off
Export Post Effects off

Options / Customization section
Use Legacy Maya Base Shader on (Maya2009 and up)
Export State Shader off
Export Maya Options off
Export Custom Colors off
Export Custom Data off
Export Custom Vectors off

Tune file export options

In Export Options (File / Export All… / Options…)
General Options section
File type: mentalRay
File Type Specific Options section
Export selection output: Renderable scene
Export file paths: Output image: none
Export selected items only: off (see below)

Tweak exported .mi file

Maya2009 and later always include Adsk shader references into exported .mi files. mental ray will emit an error message which can be ignored, it does not stop rendering.
But there are ways to resolve the problem from within Maya.
Enable filter in Export Options for include and link statements, to not write them into .mi files. Load shaders in the external application instead.
Provide custom shader libraries in Render Settings / Options / Custom Globals to override default translation, which affects both integrated rendering and export.
Use Render Settings / Options / Custom Scene Text to provide custom libraries to only affect .mi file generation but not rendering.


Here is a speed test.

My system is a dual quad core2 2.3ghz with a gtx260 216sp 1.7gb ram video card. I did time limited renders. It took an additional 8 seconds for the scene to translate on each of the iray renders. When doing iray my video card was doing all the work, my cpu usage stayed below 7%.

The 33 minute render is a mental ray standard render. I have final gather on with 4 bounces on reflectivity. My final gather accuracy is 320, contrast threshold is .4 and my sampling is adaptive 0/2.

I would like to do some multi GPU tests down the road when I have time. I will probably do some additional tests with new scenes on Monday. There are some serious limitations with iray, but there is also some serious awesomeness too. I think I might post the dlls. You only need 3 additional dlls to run it. I don’t think its a licensing issue because you already have a license to run mental ray 3.8. I don’t want to get in any trouble here though, any thoughts?


yes, it’s unbiased, since the standalone is out now, i think i can share some test


cool - looks good. If I hadn’t lost all faith in all mental ray for Maya products, I’d give it a try. I’ve got dual GTX 285s in my Mac Pro now but I’ll stick with Octane.


Matt when you get a second could you post some render times ? and GFX card ?
Can IRay deal with Proxies ?

Looking great so far.


does this work for 3ds max 2011?


Dagon, what are you using to get your DOF to work? I only messed around with it for a few minutes but I couldn’t get it to work. Have you “added” iray back into maya 2011 or are these from standalone? What is your GPU memory/tri count ratios like. Many of my production projects crash with too little memory. Their poly count is huge though. My last arch/vis scene had over 8 million tris, not even going to try that one.

yes, it works in max, we got it running there too.

I will probably do some proxy tests with some trees on Monday if no one else beats me to it. Proxies could be a make or break feature with such limited memory.


i dont know if it’s any different now, but when i tried it octane had much less features then iray, there will be a bunkspeed shot beta (with iray) soon, so you will be able to try it by yourself :wink:

i don’t think you can distribute the dlls from the standalone, but you may ask

iray can’t deal with instancing, so you can render proxies if you want, but without any help for the memory consumption


you need to use the “physical lens dof” shader
mia bokeh is not supported yet


ya, I don’t know that Octane has a better feature set yet - but it’s dead cheap and the devs are very active. The quality is great though and the film response presets are really great.

It already has better support too, so I know which I’ve chosen :stuck_out_tongue:

anyway, these test look great. keep posting


can you please put the string code here to enable Iray in Maya?


does this work for 3ds max 2011?


The very first sentence in this thread:


how do i get Iray to work in 3ds max 2011?


Big fat negatory on distributing the dlls. Sorry guys. I tried.


From the doc:

[b]iray Rendering Mode 3.8[/b]

 "iray" on|"off" 3.8Enable the [iray  rendering mode]( default value is "off"

Sot it must be:

Do you have the latest standalone rachid?