mental ray iray Maxwell support in 3ds Max 2015 SP2

Maxwell GPUs

Maxwell is NVIDIA’s next-generation GPU architecture for CUDA compute applications.

Please check the current list of Maxwell GPUs.

In order for iray to render on Maxwell GPU you need to patch the iray library which is distributed with 3ds Max 2015 SP2.

Without this patch, iray in 3ds Max 2015 SP2 will render using CPU only, if you have a Maxwell GPU.

Step by Step Procedure

Backup iray Library

iray library is typically located under:

C:\Program Files\Autodesk\3ds Max 2015\libiray.dll

The version which ships with 3ds Max SP2 is 3.12.1.17:

3.12.1.17

Rename or move your original iray library in case you want to revert back to it.

Update iray Library

Download iray library version 3.12.1.18 and place it under:

C:\Program Files\Autodesk\3ds Max 2015\libiray.dll

3.12.1.18

Restart 3ds Max 2015

Future patches and releases of 3ds Max will automatically support Maxwell generation GPUs.

More information on Maxwell architecture.

mental ray for 3ds Max 2015 SP2

mental ray for 3ds Max 2015 SP2 has been released several weeks ago.

It ships with mental ray version 3.12.1.17.

Several issues were fixed as far as mental ray is concerned:

  • mental ray hang when rendering an empty scene
  • precision problem when using Arch & Design related to computation of glossy samples
  • subset pixel rendering not showing up in rendered frame window when using mental ray

The new NVIDIA GPU Maxwell architecture is not yet supported, but we plan to release a patch very soon. Stay tuned!

 

Export your scene as .mi file from 3ds Max

Let’s pick up on the topic Let .mi export… and show how to export to .mi from 3ds Max.

Step by Step Procedure

You can simply export your scene to an .mi file in 3ds Max when using mental ray as Production renderer.

  • Go to “Rendering/Render Setup” or press F10.
  • Choose NVIDIA mental ray as Production renderer.
  • You find “Export to .mi File” in the “Processing” panel in the “Translator Options” rollout.
    Note: All the controls (but the “Browse…” button) are initially greyed out until a filename is specified.

export

  • Press the “Browse…” button to spectify the .mi file output.
  • Render or press Shift+Q. Instead of actually rendering, the scene is exported to .mi file.

You can use mental ray Standalone to render the exported .mi file.
Note: When rendering with Standalone you might see errors about missing SubstanceShader.dll and PointCloudShader.dll. These errors can usually be ignored and do not prevent proper rendering. You might want to delete the corresponding link in the .mi file to prevent these errors to show up (see link directives at the top of the .mi file).

User Interface

3dsmax_exportmifile_detail

“Export on Render”

Uncheck “Export on Render” if you want to render to the viewport instead of export to .mi file.

“Un-compressed”

If you choose to export “Un-compressed” (the default), the three dimensional vectors in objects are echoed in ASCII format. If you uncheck this option and choose to export compressed, vectors in objects are exported in binary format resulting in a smaller .mi file size and in exact floating point precision. See also the section “Export Binary vs. Ascii” in the post about exporting to .mi file in Maya.

“Incremental (Single File)”

If you select “Incremental (Single File)” options, animations are exported as a single .mi file that contains a definition of the first frame and descriptors of the incremental changes from frame to frame. If you uncheck “Incremental (Single File)”, each frame is exported as a separate .mi file.

“Browse …”

Allows to specify the output file name.

Let .mi export…

For those who use mental ray Standalone to render on a remote computer or in a render farm, the creation of a scene file in the proprietary .mi format is a necessary step. Most content creation tools are able to “echo” the full scene into a .mi representation on disk using mental ray’s built-in capability. But mental ray for Maya implements a much more flexible approach with extra functionality to ease render pipeline integration. In this post we would like to take a closer look at some of these features.

Export Options

The mental ray export options can be opened in Maya’s “Export All” or Export Selected” windows by sliding the separator handle to the left.

options panel

Maya “Export…” Options Panel

Or, click the little options box next to “Export All” or “Export Selected” menu items.

options box

Maya “Export…” Options Box

Last but not least, the file export can be triggered and controlled via scripting, like in the Script Editor. We show an example towards the end of this post.

Export Binary vs. Ascii

Similar to Maya’s ascii (.ma) vs. binary (.mb) scene formats, the .mi file can also come in two flavors: ascii or binary. The binary variant is the preferred choice when the precision of the scene data should be retained. The reason is, floating-point numbers are written in a binary form with no loss of bits and precision. Maya’s mental ray export enables binary by default.

That’s perfectly fine if you just like to feed that .mi file to Standalone for final rendering, and not touch it. In a production studio environment this is rarely the case, though. Typically, all the assets (textures, materials, geometry, …) are collected from different sources or departments, and may undergo steps of post-processing and editing before passing to the renderer. The ascii version of the .mi export is often better suited in such situations since it allows simple text editing and easier scripting. On the other hand, it may result in larger file sizes, and can lead to precision problems due to lossy ascii-binary conversions. There are ways to solve that with mental ray for Maya. Let’s take a closer look in the next sections.

Export Precision

The mental ray for Maya export engine can be tuned to use a more exact ascii conversion of extreme values that reside close to the edge of the floating-point precision range. Especially single-precision floating-point data are prone to this problem. Guess what, this is (still) most widely used to represent 3D scene geometry and transformation operations. The standard ascii conversion, which is using a maximum of 6 significant digits for single-precision values (15 digits for double-precision), can be increased up to 9 (or 18, respectively), by creating the following dynamic attributes in your scene prior to export.

addAttr -at short -ln "exportFloatPrecision" -min 6 -max 9 -dv 7 mentalrayGlobals;
addAttr -at short -ln "exportDoublePrecision" -min 15 -max 18 -dv 16 mentalrayGlobals;

Large scene dimensions and hierarchies, but also repetitive use of certain Maya modeling operations, can lead to such extreme values, see hints in the older Autodesk Knowledge Base Article.

Export File Path

A typical .mi scene contains various references to external files, like textures, finalgather maps, or output images. When rendering on a remote machine or in the render farm, the directory path to these files may be totally different than what was used on the exporting machine. Therefore, it is often desirable to not write an absolute file path into the .mi file, but just the relative one rooted at the project directory, or no path at all, and then use mental ray Standalone’s search path configuration on the remote computer to point to the right folders, or shared network drives. For example, using the “-T <path>” command line option, or the _MI_REG_TEXTURE registry value.

The mental ray for Maya export options provide selective control for each type of file.

export path names

Maya Export Options – mental ray File Path

Export Filter

This section of the export options allows to create .mi files that only contain elements of a certain scene type, like all “textures”, or all “materials”. It translates the full scene as usual but actually writes only the pieces selected in the “filter”. This way it is possible to split up a large scene into more manageable .mi parts that fit together perfectly. Here is an example. It will export three .mi files:

// Textures, Scene Data (zipped), Camera + Options + Render
Mayatomr -mi -file "textures.mi" -exportFilter 8388599 -xp "abs";
Mayatomr -mi -file "scene.mi" -exportFilter 1704591 -compression 1;
Mayatomr -mi -file "render.mi" -exportFilter 7699832;

The “textures.mi” file contains just the textures references, all with absolute file path. The “scene.mi” file carries most of the scene data, geometry, lights and materials, and gets compressed to save disk space. Finally, the last one “render.mi” stores the render options, render cameras, and the final render command. Now, the first two .mi files can be included into the last one “render.mi” to create a renderable “master” .mi file, see this .mi snippet:

    ...
$include "mayabase.mi"

$include "textures.mi"
$include "scene.mi.gz"

options "miDefaultOptions"
    ...

The resulting .mi file can be given to mental ray Standalone for final rendering. Arrgh, I got a new version of one of the textures last minute! Well, no problem! Just update the “textures.mi” file, no need to touch any of the heavy data. And re-render. Voila!

While this works great in general, it does not help the renderer to load certain scene parts on demand only, like when it is actually “seen” during rendering. That’s where mental ray “assemblies” come into play.

Export Assembly

This export option helps to create a valid mental ray “assembly” from a Maya scene. It writes a normal .mi file with a few special properties. A mental ray assembly is used to store a larger part of the scene that belongs together spatially, like a character or a whole building. Normally, it comprises the geometry details of the sub-scene and related local properties like materials.

Maya Export Options - mental ray Export Render Proxy (Assembly)

Maya – mental ray Export Assembly

Model courtesy Lee Anderson.

Such a .mi file can be referenced from a “master” scene “stand-in” bounding box object, which defines the ultimate location and scale in the global space.

load assembly

Maya – mental ray Load Assembly

In contrast to Maya file references, such an assembly is not loaded or shown in Maya immediately, thus not filling up memory and impacting your modeling operations. Instead, mental ray will load these parts only on demand during rendering, and even unload the piece in case room for other assemblies is needed. This mechanism enables the renderer to handle massive amounts of scene elements more efficiently, and keep memory consumption under control. The resulting rendering is no different to a regular render.

maya render view

Maya Render View – mental ray

Model courtesy Lee Anderson.

If you like to build a scene that contains huge amounts of similar looking objects that can share the actual assembly geometry, we suggest to use instances of the same assembly rather than copies (!) (which is the default “duplicate” operation in Maya). The placement and scale of the stand-in “proxy” element referencing the assembly determines the final location and size in the final rendering.

maya model view - mental ray assembly instances

Maya Model View – mental ray Assembly Instances

mental ray assembly instances

Maya Render View – mental ray Assembly Instances

This technique of using mental ray assemblies is also available to shader writers and integrators through the programming API. In fact, it is utilized in the mental ray implementation of crowd simulation engines like Massive for Maya, or Maya’s native procedural generator XGen, to handle incredible amount of elements.

We hope these tips will help you in your daily work.

BTW, there are more possibilities to tweak .mi file export even further (“text boxes”). But they are rarely used, and would justify another blog post in case there is interest. Just let us know.

Happy rendering!

mental ray for Maya 2015 SP4

mental ray for Maya 2015 SP4 is now available for download. It ships with mental ray version 3.12.1.18.


These are the most important fixes:

  • We are glad to announce that we were able to remove the cause for freezes and crashes on Mac OS X version 10.9, “Mavericks”.   To our Mac OS X users, test it out and let us know your experiences.
  • Some problems around motion blur of XGen geometry were fixed. Please, note that we still recommend setting the Motion Steps parameter to 1 when using XGen hair with motion blur (see mental ray Motion Blur Settings in the XGen Preview/Output window) . This issue will be fixed in the future.XGenMotionSteps
  • Artifacts with texture caching of Tiff textures as well as a problem with imf_copy and multiple level support were fixed.

Check out the Maya 2015 SP4 release notes inside the download for the complete list of fixes and the complete mental ray documentation

Thanks for your feedback.

I am on a Mac, and use mental ray for Maya. But…

Hello Mac users,

you love to stay on your Mac and use mental ray for Maya?

No problem, since Maya offers the same Qt user interface and experience like on Windows or Linux. Maya scene files and mental ray .mi files that have been generated on other platforms can simply be used on the Mac. Even the configuration files, “Maya.env” and “maya.rayrc”, work identically. All true, but…

Several things are different. For example, the unique use of Mac specific keyboard shortcuts is puzzling, like in the “open scene” window. Switching to the “OS native” file dialog is possible in the Maya preferences. Although it might even be more confusing to use Qt and non-Qt side by side.

What about mental ray ? Well, it is only dependent on the underlying Unix basis “Darwin” with its stable and standardized interfaces. That keeps it quite independent from frequent Mac OS X updates, which typically just touch the application levels of the operating system.

Normally. But the most recent “Mavericks” update of OS X, version 10.9, seem to have changed some multi-threading behavior of the kernel. mental ray is obviously also affected, and shows unexpected interruptions, or even gets blocked completely during rendering. Our developers are currently diving into it, to come up with a solution as soon as possible.

Here is another little annoyance:

The message log for mental ray preview rendering has disappeared a few Mac OS X versions back, also due to a system change that handles console output. The batch rendering is not affected since it writes the messages to a file. There is a workaround for preview rendering, though, using mental ray for Maya’s built-in log facility that works separately to the system log. It can be enabled on the Maya command line like this (also useful for a Shelf button):

Mayatomr -preview -log

It will create a file with the fixed name “mentalray.log”, typically residing in the last opened scene file directory. Double-clicking on the file in the Mac Finder will open the Console App, giving a similar experience to the message display on other platforms. If you enable the Console preference “bring log window to front” it will pop up automatically with each mental ray rendering of that scene using the -log command.

mental ray messages

mental ray for Maya log messages

Happy rendering!

mental ray for Maya 2015 SP3

mental ray for Maya 2015 SP3 is now available for download here.

This service pack ships with mental ray 3.12.1.17


The most important fixes are:

  • Progressive rendering in the IPR is more responsive now, especially when finalgather is off.
  • Refractions and reflections are enabled for maya_volumefog.
  • Deforming animation in Alembic files imported using GPU Cache is fixed for batch rendering.
  • Fixes in the mental ray core:
    • Unified sampling: fixed possible crash if coverage framebuffer was used in combination with unified sampling.
    • Light importance sampling: reduction of noise artifacts when using point lights with non-physical falloff.
    • Stabilize flushing mechanism for rendering very large scenes.
  • Shader fixes:
    • For layering material shaders (MILA), added support for back_scatter LPE pass.

Check out the Maya 2015 SP3 release notes inside the download for the complete list of fixes.

Complete mental ray documentation can be found here.

BTW, some of these problems were reported here and on the beta forum. Thanks for your feedback!

Follow

Get every new post delivered to your Inbox.

Join 913 other followers