Page 1 of 2 12 LastLast
Results 1 to 10 of 18

Thread: Maya 2011, 2012, 2013 and mental ray iray

  1. #1
    Join Date
    Jan 2009
    Location
    Berlin/Germany
    Posts
    571

    Exclamation Maya 2011, 2012, 2013 and mental ray iray

    Hello mental ray for Maya users.

    (Note: updated for latest Maya and mental ray versions.)

    The editions of Autodesk Maya 2011, 2012, and 2013 come with the latest version of mental ray integrated, like 3.8, 3.9, and 3.10 respectively. Those versions of mental ray provide the capabilities to use the iray rendering mode. This is our most recent technology to render photo-realistic images at interactive frame rates with the help of modern GPUs supporting CUDA.

    Please refer to our website for rmore details. But let me summarize the iray rendering mode here as well :

    The iray rendering approach computes all dominant and subtle lighting effects in a scene without the need for tuning and tweaking parameters of the algorithm. It is able to leverage modern GPUs for computations, and the resulting rendering performance scales almost perfectly with the number of CUDA devices in a multi-GPU setup. This delivers extreme speed improvement for compute-intensive effects like indirect illumination or image-based lighting. For the first time, the physically correct behavior of light and shadow can be studied interactively in all aspects, without compromising quality.

    Unfortunately, a true interactive integration of iray is not yet available in any Maya edition. On the other hand, the mental ray Standalone does provide the iray rendering components. This offers the possibility to start experimenting with the iray rendering mode in the typical iterative standalone rendering workflow: create Maya scene >> export to .mi file >> render with Standalone.

    For those of you who like to get hands on iray with mental ray for Maya I'm collecting helpful information and tips in this thread. More general topics may be discussed in the separate iray forum.

    Happy rendering

    Steffen Roemer
    Product Manager mental ray
    Last edited by steve; January 25th, 2013 at 20:20. Reason: link to iray forum

  2. #2
    Join Date
    Jan 2009
    Location
    Berlin/Germany
    Posts
    571

    Lightbulb How to model a scene to render with iray

    Introduction

    The iray rendering engine uses a fixed set of BRDF materials and shading effects. Many existing shaders are automatically mapped to this internal shading model. If a shader is not supported by the shader translation mechanism then the material or effect is skipped, which typically renders this effect black or invisible.

    A Maya scene can be tuned to use only the subset of shaders and effects which is supported by iray. Different versions of iray handle certain shaders differently. For example, the Shading Engine (also known as Shading Group) may be properly detected and skipped by iray, or, otherwise, it has to be disabled in the Attribute Editor of the Shading Engine.

    Prepare Scene for iray

    The iray shader mapping supports a list of shaders. 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


    Avoid shading tricks and non-physical approximations

    The iray rendering engine is simulating laws of physics for lighting. It delivers superior photo-realistic results when the whole scene description is based on physically plausible models, like
    • light sources with size and shape,
    • surface models with thickness, like no single-sided glass,
    • surface materials based on BRDF descriptions, or mia_material shaders which are emulated,
    • surface structure that is explicitly modeled, including displacement but no bump or normal mapping.


    Note, that most of these traditional workflows are supported by iray as much as possible, but this may break physical correctness thus introduce artifacts like improper surface shading or wrong illumination.

    How to achieve certain effects

    Camera Lens Effects

    • use phyiscal_lens_dof on Maya camera mental ray Lens slot


    Tone Mapping / Film Exposure

    • use mia_exposure_photographic on Maya camera mental ray Lens slot
    • use mia_exposure_simple on Maya camera mental ray Lens slot


    Common Light Sources (ambient, directional, point, spot)

    • Maya light sources with high intensity values
    • Maya light sources with custom light shader physical_light


    Area (Shape) Lights

    • Maya Area Light with mental ray Use Light Shape enabled, all shapes supported except user


    Environment Lighting

    • use Maya camera Environment / Background Color
    • use environment shader on Maya camera mental ray Environment slot
    • for IBL from HDR image, use mib_lookup_sperical
    • for Sky Light, use mia_physicalsky


    Light Emitting Objects

    • mia_material_x with additional color on any shape
    • mia_light_surface on any shape


    Surface Structure (Shaded)

    • Maya bump2d or bump3d node on mia_material overall bump


    Surface Structure (Tessellated)

    • Maya displacement, will be performed by mental ray CPU and final tessellation passed to iray


    Single Surface Material

    • use mia_material and mia_material_x, start with the presets


    Layered Material / Coating

    • not supported as shading effect, model the layer as a thin offset surface


    Decal / Textured Material

    • use Maya file node on any input of surface shader
    • use mib_texture_lookup on any input of surface shader


    Volumetric Shading

    • not supported as shading effect, model volume as grid of surfaces


    Subsurface Scattering

    • not supported as shading effect, model subsurface layer as surface with low gloss and translucency
    Last edited by steve; July 23rd, 2010 at 12:50. Reason: typos

  3. #3
    Join Date
    Jan 2009
    Location
    Berlin/Germany
    Posts
    571

    Lightbulb How to enable iray rendering in mental ray for Maya

    Introduction

    The mental ray for Maya integration allows to enable iray rendering mode in the Maya scene. Even if Maya doesn't offer a user interface for setting iray options, the existing interface for string options is sufficient to turn on iray and set progressive options for automatic stop of the rendering. These options are also transferred with the exported .mi file to a mental ray Standalone 2011. As usual, the standalone mental ray allows to override these options on the command line.

    Enable iray rendering in mental ray for Maya

    The iray rendering mode is enabled using string options. They can be added by hand, or using a MEL script. Please note, select mental ray as your renderer in Maya and start at least one rendering to establish all mental ray nodes required for the following procedure.

    Adding iray options manually

    • Go to Maya MEL command line (Display / UI Elements / Command Line)
    • Type the following words and press Enter :
      Code:
      select miDefaultOptions
    • Open the Attribute Editor.
    • Go to section String Options.
    • Click Add New Item as many times as the number of options you like to add.
    • Scroll down to the end of the list and fill out the empty fields with :
      • a name (same name as in mental ray),
      • the type (boolean, integer, scalar, color, vector, string),
      • and the value.


    For iray to stop automatically, add :

    • iray, on, boolean
    • progressive max samples, 1000, integer
    • progressive max time, 10, integer
    • progressive error threshold, 0.01, scalar


    This will stop iray rendering automatically if either 1000 samples have been taken, 10 seconds of render time have passed, or the error measure has been reached, whatever comes first.

    Adding iray options by script

    Copy the following lines of MEL script code into the Maya script editor and execute it. Once this was successful the scene contains new options, and they will be stored with the Maya scene file. The options are gone if a new scene is created, so the same MEL code has to be executed in order to use iray to render this new scene. It is convenient to turn on the Maya preferences option to Save Script Editor Contents.

    Code:
    select miDefaultOptions; 
    int $idx = `getAttr -size miDefaultOptions.stringOptions`; 
    setAttr -type "string" miDefaultOptions.stringOptions[$idx].name "iray"; 
    setAttr -type "string" miDefaultOptions.stringOptions[$idx].value "on"; 
    setAttr -type "string" miDefaultOptions.stringOptions[$idx].type "boolean"; 
    $idx = `getAttr -size miDefaultOptions.stringOptions`; 
    setAttr -type "string" miDefaultOptions.stringOptions[$idx].name "progressive max samples"; 
    setAttr -type "string" miDefaultOptions.stringOptions[$idx].value "1000"; 
    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 "10"; 
    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.01"; 
    setAttr -type "string" miDefaultOptions.stringOptions[$idx].type "scalar";
    Last edited by steve; June 17th, 2010 at 18:22. Reason: Add hint to render first

  4. #4
    Join Date
    Jan 2009
    Location
    Berlin/Germany
    Posts
    571

    Lightbulb How to export .mi files without Maya extensions

    Introduction

    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 by default. To get rid of this the following steps need to be performed (manually or per script).

    Create non-Maya-specific scenes

    Do not use native Maya material shaders

    • Assign materials from Lighting/Shading / Assign New Material menu, in the bottom mental ray section only.
    • After assignment, the Attribute Editor (AE) opens for the Shading Engine node , aka Shading Group (SG).
    • In Custom Shaders section you may set :
      1. Suppress all Maya Shaders on
      2. Export with Shading Engine off
      3. 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 mental ray section
    • Image-Based Lighting (Render Settings / Indirect Lighting / Image-Based Lighting), instead attach environment shader in the camera mental ray section, or use Physical Sun and Sky


    Tune global translation options

    In Render Settings (Window / Rendering Editors / Render Settings)

    • Common / Render Options section
      1. Enable Default Light off

    • Options / Translation section
      1. Export Particles off
      2. Export Particle Instances off
      3. Export Fluids off
      4. Export Post Effects off

    • Options / Customization section
      1. Use Legacy Maya Base Shader on (Maya2009 and up)
      2. Export State Shader off
      3. Export Maya Options off
      4. Export Custom Colors off
      5. Export Custom Data off
      6. Export Custom Vectors off


    Tune file export options

    In Export Options (File / Export All... / Options...)

    • General Options section
      1. File type: mentalRay

    • File Type Specific Options section
      1. Export pass contribution maps off
      2. Export pass user data off
      3. Export selection output Renderable scene
      4. Export file paths Output image: none
      5. Export selected items only off (see below)


    Tweak exported .mi file

    Maya 2009 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.
    Last edited by steve; July 23rd, 2010 at 12:25. Reason: clarifications

  5. #5
    Join Date
    Feb 2006
    Location
    France
    Posts
    79

    Default

    I have a problem with GPU computation inside Maya 2011, CPU is always fine after removing nvcuda.dll.

    Iray GPU works curiously well with XP64 and quadroPlex ( based on FX5800 ( driver 259 )).
    I really enjoy speed.

    But when using Win7 with other CG ( FX1800 / Quadro 5000 ) i have error message
    " IRAY 0.11 fatal: CUDA error 18:invalid texture reference".I have made different driver tests, i have renamed nvcuda.dll from C:/windows/system32, but the problem still occurs.Installing latest drivers but i still have the problem.Not sure it is a driver problem ??
    Currently it has never been possible to run iray into maya on Win7 OS.

    Any idea ?
    Visualization Team | Digital Rendering Process
    Renault Design

  6. #6
    Join Date
    Jan 2009
    Location
    Berlin/Germany
    Posts
    571

    Default

    Are you using the original iray version 1.0 with Maya 2011 ? The error message you are seeing is typically an indication of a mismatch between iray 1.0 that was developed for a certain (older 2.x) CUDA version, and the actual CUDA and driver installation on your computer. Later versions of iray should run more reliably on most recent systems and graphics cards.

  7. #7
    Join Date
    Feb 2006
    Location
    France
    Posts
    79

    Default

    Thank you Steve,

    I don't know which iray version i am using inside mentalray 3.8.1 dlls.
    If i can upgrade to a more recent cudart.dll libiraymr.dll libiray.dll to fixe the problem it is great !
    or i have to wait for next 3.9 release.In that case i am not sure it will work with Maya 2011.

    Nice to hear from you Steve - Wishing you happy new year
    Last edited by shangu; January 4th, 2011 at 21:24.
    Visualization Team | Digital Rendering Process
    Renault Design

  8. #8
    Join Date
    Jun 2010
    Posts
    5

    Default

    Quote Originally Posted by shangu View Post
    I have a problem with GPU computation inside Maya 2011, CPU is always fine after removing nvcuda.dll.

    Iray GPU works curiously well with XP64 and quadroPlex ( based on FX5800 ( driver 259 )).
    I really enjoy speed.

    But when using Win7 with other CG ( FX1800 / Quadro 5000 ) i have error message
    " IRAY 0.11 fatal: CUDA error 18:invalid texture reference".I have made different driver tests, i have renamed nvcuda.dll from C:/windows/system32, but the problem still occurs.Installing latest drivers but i still have the problem.Not sure it is a driver problem ??
    Currently it has never been possible to run iray into maya on Win7 OS.

    Any idea ?
    I have this exact problem
    Iray works on older machines, but not on my newer one.
    How do I tell which version of iray I'm using, and how would I go about updating it if it is 1.0?
    I have the same " IRAY 0.11 fatal: CUDA error 18:invalid texture reference" message, does that indicate that iray's version is "0.11", or is that an unrelated to the version?

    Thanks for any help
    Last edited by JBoris; January 9th, 2011 at 15:51. Reason: added a bit of detail

  9. #9
    Join Date
    Feb 2006
    Location
    France
    Posts
    79

    Default

    This problem is a bug.

    To work around Autodesk un-supported iray integration, i have made a test to run Mentalray Standalone 3.8.1 supposed to support iray to render a mi file with iray ( -iray on ) and i have exactly the same crash "IRAY 0.11 fatal: CUDA error 18:invalid texture reference" on different graphic cards with updated drivers ( FX1800 / Quadro 5000 / GTX 470 )
    Mentalray Standalone and Maya 2011 behave the same way, crashing on WIN7, working on XP.

    hope this help.
    Last edited by shangu; January 10th, 2011 at 21:33.
    Visualization Team | Digital Rendering Process
    Renault Design

  10. #10
    Join Date
    May 2009
    Posts
    34

    Default

    Any idea what this error means?

    IRAY 0.15 fatal: CUDA error 11:invalid argument

    Cheers,
    Robert

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •