Using the Physical Area Light in Maya 2016

In this fourth post in a series on mental ray for Maya 2016 Render Settings, we follow up on the Using Modern Materials and Lights post with more detail on the new Physical Area Light.

Where to find the new Physical Area Light


Note the new mental ray section. All lights below the line are mental ray lights.

Convenient Creation of Maya Area Light

The Physical Area Light is a Maya Area Light set up using the mila_light shader, for best operation with Layering (MILA) materials.

By default, the settings are as follows:

  • Physically-based falloff (Light Decay is Quadratic)
  • Shapes supported by mental ray (Light Shape Type is Rectangle)
  • Intensity connected to the mila_light
  • Color connected to the mila_light, supporting textures

Scene scale matters

The Physical Area Light has physically-based falloff (Light Decay is Quadratic) so the intensity of the light compared to the scene scale matters. It is the number one reason we find when troubleshooting a physically-based scene that renders black or dark. Take the following example.

A default polygon plane is created on the default grid.default_grid_and_plane1

The plane is scaled up to the size of the default grid.default_grid_and_plane2

A Physical Area Light is created and moved to 4 units above the plane.default_physical_area_light1

Then rendered, noting that the default intensity of the light is 100.default_physical_area_light2

Now the light is  moved to 10 units above the plane.default_physical_area_light3

Rendered. And barely lighting this  plane, so more than that requires more light intensity.default_physical_area_light4

Also, the size of  the area light matters.

A flashlight can light up a baseball, but it cannot light up a baseball field. This kind of thinking has to start informing your lighting decisions. But once you get used to it, it may actually help you work more efficiently to produce realistic lighting results.

Lighting Quality

With Light Importance Sampling (LIS) on, the area light Samples settings are ignored, and quality of direct lighting can be more easily controlled with the Lighting Quality setting in the Quality tab of the Render Settings. This is especially useful for scenes with many lights.


Using textures

Because the Physical Area light automatically uses the texture-able mila_light shader, one can set the input for the light Color with a Maya File node. By the way, we also updated the physical_light to be able to use textures, but now the mila_light is preferred, as it will evolve with the physical area light.


Example using an HDR textured rectangular area light. The intensity multiplier scales the values whether they are HDR or LDR. It’s just a multiply of whatever the texture returns. In other words, the texture is not normalized before multiplication.

Spot edge falloff

The physical area light defaults to use a point light output pattern over the surface area of the light. In order to use a more spot-like falloff for the edges of the area, we need to adjust the area light. To do this, change the light type of your  Physical Area Light from Area Light to Spot Light. It is still a Physical Area Light because it uses the light shape. The mila_light shader remains hooked up to the  color and the intensity.

mental ray For Maya Beta with NVIDIA

We are now beta testing Pi-ray, our exciting new version 3.14 of mental ray, within Maya 2016, in a private mental ray For Maya beta test. If you are interested, please email, with your beta test request. Please state your company, how you use mental ray, and your machine configuration. In addition to registering in our forum, you need to have Maya 2016 and the mental ray for Maya 2016 plugin installed before installing the beta plugin.

The following image is rendered with the latest global illumination (GI) algorithm in 3.14. Enter the beta test to find out some great things about the latest GI.


Using Modern Materials and Lights in Maya 2016

In this third post in a series on mental ray for Maya 2016 Render Settings, we assume you are familiar with the concepts presented in the introductory post and the second post on adjusting quality.

Modern Materials and Lights

We recommend physically-based materials and lights to fit a modern workflow. In this post, we focus mostly on the materials, and we will follow-up with more posts on lights. These materials are designed to work more compatibly with unified sampling, and the simpler UI quality controls. They provide the flexibility of balance in adjusting global vs. local sampling quality controls.


The Layering (MILA) material not only provides better compatibility with unified sampling and quality controls, but it also provides simple passes which can help you to adjust the quality settings.

For example, this interior scene using mila materials clearly demonstrates the difference between direct and indirect lighting. The left picture has no indirect diffuse lighting as it is turned off in the Render Setting Quality tab, and the right picture has Indirect Diffuse (GI) Mode turned On with a depth of 4. Note that the 2 pictures below are organized in a gallery, so that if you click on them, you can see a larger version. Click on x upper left to get back to this page.

The direct lighting quality is controlled with Lighting Quality, while the indirect quality is controlled with Indirect Diffuse Quality when Indirect Diffuse (GI) Mode is On.

quality_tab_samplesIf using mila_materials, we can easily turn on the direct_diffuse and the indirect_diffuse passes in the Scene tab under Camera>Passes.


Then, we can see the relationship between the pass results with respect to their quality. Note again that the 4 pictures below are organized in a gallery, so that if you click on them, you can see a larger version, and step through each with a right, left arrow.

Below we increase the Indirect Diffuse (GI) Quality to reduce noise in that pass.

Adjusting (MILA) Material Quality

Use the (MILA) Material Quality to address noise caused by the material sampling.  For the layering library (MILA) materials with either glossy reflection/transmission or scatter components, the Material Quality controls the number of samples, ie the outgoing rays split out from the interaction of the material with an incoming ray. In a sense, this is the indirect quality aside from the indirect diffuse, i.e., the indirect glossy and scatter components.

When Advanced Settings are on, we provide separate Glossy Quality and Scatter Quality controls in case the noise differs significantly between these components. Note that the material quality settings are relative, so controlling Material Quality will continue to control both glossy and scatter quality.  The material quality is multiplied by glossy or scatter quality to determine a quality for each respective component, with all defaults at 1.0.

When Advanced Settings are on, we also see Glossy and Scatter Quality
When Advanced Settings are on, we also see Glossy and Scatter Quality under Material Quality

Note that the passes for indirect glossy/specular and scatter directly correlate in quality to these settings.

Increasing Glossy Quality

Increasing Scatter Quality


Scene Settings Shared across Materials

Note that for the MILA shaders, we provide quality settings by scene. In other words, all the materials in the scene share the settings. This makes it easier to control in a typical scene with many materials, rather than per-shader. It also allows the renderer implementation to optimize better.

Besides quality, we have several other useful render settings that are shared by the mila materials. They are in the Scene tab in the Materials section.

Layering (MILA)


Reducing very high dynamic range results

MILA Clamp Output

Clamps the output of mila_material. This is an enable, for using the clamp level. If off, light transports through the scene in the most physically-accurate way, though with high dynamic range lighting, more quality may be required. The default is off.

MILA Clamp Level

The level used for clamping, typically between 1 and 10, based on desired output.

Understanding internal reflection

When making a material to model colored glass, not only do transmission paths inside the glass need to be colored, but also, if one of those paths reflect inside the glass again (internal reflection), it should be colored. Depending on your scene, this may be more or less subtle of an effect visually.

A material with a reflection component could be on the outside or the inside, so the max distance parameter for a reflection component needs information as to whether it is modeling physically-correct internal reflection, or modeling the legacy max distance render trick for the external reflections. We recommend using colored max distance primarily for internal reflection, when combined with a transmission component, and therefore, make this the default.

MILA Use Max Distance Inside

Use the max distance for reflection internally for colored glass. On is the default. If off, the max distance is used for external reflections, those bouncing off the outside of an object, instead of internal reflections.

Scatter look adjustment

Modern rendering uses more quantities that depend on scene units, such as the distance to scatter with mila_scatter. In the Materials section of the Scene tab, we provide a global scaling factor for scatter distances.

MILA Scatter Scale

The MILA Scatter Scale is very convenient for re-using materials across different size scenes. It multiplies by the local scale control, if exposed, in the (MILA) scatter component. Below we show how increasing the scale makes the scatter pass look more like the diffuse pass, with less and less scattering.

For practically good results the scatter pass should look barely noticeable when mixed in with all the other passes.

Layering complexity not a significant performance factor

At SIGGRAPH 2015, I noticed how many users were still concerned that the number of layers in a material may affect performance. For modern materials, such as MILA and MDL, this should not be of concern. The elemental component structure provides the renderer with this ability. The material can either be selectively sampled or flattenend for a single minimal BSDF representation, and as the depth of a ray increases, more optimizations can occur.


Use physically-based mental ray lights such as the Physical  Area or Environment lights. See Create>Lights>mental ray section


All lights in this section default to quadratic falloff for physically-based lighting, and compatibility with the modern techniques including Light Importance Sampling (LIS). With LIS, the Lighting Quality can be used for direct lighting quality.

In our next post, we will introduce the Physical Area Light, and in another post we will provide more detail for the Object Light, which is a special case of the Physical Area Light assigned to an object for emission. We will also provide a post on how to use the newly packaged Environment Lights.

NVIDIA vMaterials

The vMaterials are a collection of MDL materials designed for physically based rendering, representing real world materials. You can register for a free download here. vMaterials can be rendered with mental ray 3.13 as well as with any Iray plugin, such as NVIDIA® Iray® for Maya.



To use the vMaterials for rendering with mental ray for Maya 2016, you have to add the following definition to your Maya.env file (on Windows):

MI_MDL_PATH=C:\ProgramData\NVIDIA Corporation\mdl;C:\Users\<YourUsername>\Documents\mdl;

To find out how to apply the MDL materials in your scene, check our post on Using MDL with mental ray for Maya 2016.

Some materials are dependent on the scene unit and assume meter by default. You can either change the scene scale to meter or you can convert the scene unit dependent parameters. For example, the clarity parameter in the gem materials should be multiplied by 100 if the linear working unit is centimeter.

Note: mental ray 3.13 supports MDL v1.1 and the vMaterials are based on MDL v1.2.  Nevertheless, most materials are compatible and can be rendered with mental ray 3.13 out of the box.

Rendering Deep Images with mental ray in Maya 2016

Deep OpenEXR files allow to store a variable number of samples per pixel at different depth locations to aid advanced depth compositing workflows.

To render a Deep OpenEXR file with mental ray, open the Render Settings dialog and make sure that the image output format is set to “exr” in the Common tab:


In the Scene tab, enable the “Use Deep Image format” checkbox:


The  Deep OpenEXR file is written in multi-part, which means that files can contain a number of separate but related images. Each render pass gets its own part (i. e. direct_diffuse, indirect_diffuse).

In order to save memory during rendering, mental ray creates tiled Deep OpenEXR files. These files need to be converted to scanline for use in compositing applications like Nuke. This conversion can be performed using imf_copy, a command line tool that is part of your mental ray for Maya installation. It can be found in the bin directory. Call

imf_copy -s tiled-exr-file.exr scanline-exr-file.exr

to perform the conversion. Click on the image below to see a screenshot of the tool executed on a Windows system:


Please note that currently only z front is supported. This means that rendering deep volumes is not possible yet. Deep and flat data cannot be mixed in the same OpenEXR file.



mental ray for Maya 2016 SP2

mental ray for Maya 2016 SP2 is now available for download here or it is automatically installed by the Autodesk Application Manager.
It ships with mental ray which contains improvements for the BSP2 acceleration structure in certain cases, bug fixes for multi-host rendering and for some framebuffer handling issues. The release notes provide more details.

Several bugs were fixed in the mental ray for Maya translator, notably concerning undo when modifying simple mila_material parameters, satellite rendering issues, and a workflow improvement with regard to the new Create->Lights menu and Environment lights.

mental ray for Maya 2016 SP1

mental ray for Maya 2016 SP1 is now available for download here.
It ships with mental ray Both the mental ray core and the integration provide important fixes that we will list in this post.

MDL rendering: latest MDL fixes are incorporated into SP1.

The new version of the MILA layering shaders fixes various issues:

  • alpha channel computation for specular and glossy transmission
  • possible texturing artifacts if mila_light light shader was used
  • halo effect on specular highlight when using mila in IPR
  • possible black pixel artifacts / NaN warnings in custom curve layer weights
  • unknown tag access fatal if mila_specular_transmission was used in combination with irradiance particles or with the GI Next prototype
  • missing subsurface scattering effects behind refractions
  • possible issues with semi-transparent objects in segmented/sorted shadow modes
  • possible tile artifacts in particular with glossy reflection mix
  • VP2 display for mila is now also working for scenes created with Maya 2015

UV-tiling: There was a severe bug around uv-tiled textures and conversion to .map textures: the conversion to .map would sometimes be automatically triggered. This is fixed now. The conversion will only occur if ‘Use optimized textures (auto-conversion)’ is checked in the rendering preferences. (There is a known issue in this context: the button ‘Update optimized cache textures now’ only converts the first uv-tile of a uv-tile sequence. The others will be converted during the first rendering.)

Also, when you created two file texture nodes both referencing the same uv-tile sequence, this could lead to a crash with the previous version. This is now resolved.

There are also various performance improvements in the SP1 version:

  • Since Maya2016, the new shadow mode default is “shadow segments”. This mode supports all ray tracing effects including subsurface and volume scattering in contrast to the approximate, thus potentially faster “simple” shadows. With the latest mental ray, we have improved the performance of “shadow segments” on scenes with extremely high depth complexity.
  • Light Importance Sampling is now faster for scenes with a mixture of large and small are lights.
  • Mental ray render times with procedural shaders/textures (ocean, fractal, and so forth) are also improved.

Adjusting Quality in Maya 2016

In this second post in a series on mental ray for Maya 2016 Render Settings, we assume you are familiar with the concepts presented in the introductory post.

Adjusting Overall Quality

Overall quality is the primary control for adjusting quality vs. speed. When there is noise in the scene, typically increase this quality.

In our example scene below, we set Overall Quality to an extremely low 0.01. Please note the edge aliasing on the tops of the spiral cone object. The back wall also has a bump texture which has noise at this quality setting.

Overall Quality 0.01

In the following images we increase the overall quality from 0.2 to 1.0 by 0.4. Note the better anti-aliasing at the edges of these objects, in particular.

Overall Quality 0.2
Overall Quality 0.6
Overall Quality 0.6
Overall Quality 1.0
Overall Quality 1.0

To visualize how eye ray samples were placed in the rendered image, from the Diagnostic tab check Diagnose Samples before rendering. With this checked, each render creates special informational passes for diagnostics including samples, error, and time per pixel. To view it, from the Render View File menu in Load Render Pass, choose the Diagnose samples pass.

render_pass_diagnose_samplesThis will bring up an imf_disp window with the samples pass already tone-mapped to see the sample density in gray scale clearly.


Note the green arrow above pointing out useful information in the bottom bar. Wherever you locate the cursor on the image, in this bar you will see the pixel location, [202 48], and the number of samples, 15 in this case.

Here are a set of samples diagnostics to match the increasing quality from our scene above from 0.2 to 1.0. Whiter areas have more samples.

Overall Quality 0.2 Samples Diagnostic


Overall  Quality 0.6 Samples Diagnostic



Balancing Quality Adjustment

Although Overall Quality can be used to handle most quality vs. speed adjustment, we can provide understanding how to get to desired results more efficiently. Understanding is important to prevent artists from quick fixes that turn out to take longer than originally planned.

With that said, it is possible to balance the local vs. the global quality settings for faster renders. This balance will evolve as machine resources change and rendering technology adapts.  For example, a brute force render running on GPU might rely solely on a global quality control, since pure path tracers do not split eye rays by design. However, current mental ray provides flexibility in how much you want to tip this balance one way or the other. It can evolve at your pace, and fit your CPU and GPU resources as they evolve.

Use the local quality controls when there is an unbalanced amount of noise from lighting or from materials. For example, if the direct lighting appears to create more noise than other aspects of the scene, increase the lighting quality for optimum speed vs. quality tradeoff. Once adjusted, the overall quality can be used as the main control again.

Consider lighting quality adjustment when the lighting has a large variation. For example, when using a large (> 40) number of lights, or several large area lights. Or when using a high resolution, highly varying HDR image for your light texture. For example, below we have one rectangular area light showing its HDR texture clearly as not uniform. Its range reaches up to values of 70 in a thin horizontal line in the middle of the thick one you see at this exposure. It required less light intensity as well as high lighting quality.

Consider indirect diffuse or material quality adjustment when noise appears on indirectly lit diffuse or glossy surfaces. Or on surfaces with a lot of geometric detail. If you ever had to work with an ambient occlusion (AO) pass that needed more samples, you have a rough idea of the kind of look difference due to geometric variation. The surface details can come out a bit more clearly, with less noise.

Adjusting Lighting Quality

The Lighting Quality controls the number of direct light samples used, when a ray hits an object. It takes into account the number of lights, both point and area, and other factors to determine how many light samples to use.

The scene used for our example has 14 area lights with sphere shapes. Note the quality of the direct lighting on the floor as we increase lighting quality. In this series, we keep Overall Quality at 0.25 and increase Lighting Quality from 0.2 to 1.0 by 0.4 steps.

Lighting Quality 0.2
Lighting Quality 0.6
Lighting Quality 1.0
Lighting Quality 1.0

When using Lighting Quality in the new UI, mental ray overrides the explicit area light samples set in each area light with a global samples-per-light setting. (Currently, it does not gray out the samples settings in the area light AE UI). The total number of light samples are re-allocated based on importance. For example, more samples may be taken from closer, or higher intensity, lights.

Tip: If you are having difficulty isolating the visual noise for adjusting direct lighting quality, use MILA light passes to help you see it. In the Scene tab, enable the direct diffuse pass and adjust to minimize noise in that pass, compared to other passes or the beauty itself.

For example, the following images show the direct diffuse pass from the above renders, as Lighting Quality increases from 0.2 to 1.0 by 0.4 steps.

direct_diffuse_lighting_quality_0.2 direct_diffuse_lighting_quality_0.6 direct_diffuse_lighting_quality_1.0

We will show more detail about light passes in our upcoming post on light passes.

Environment Lighting Quality

Controls the number of environment light samples to use. Also using importance, it is separate from lighting quality and enabled when environment lighting is enabled. We will give examples of this in a later post in this series about environment lights.

Adjusting Indirect Diffuse (GI) Quality

We encourage the selection of On (GI Prototype) mode, over Finalgathering and other legacy modes, for its reduced controls and higher quality. When On, mental ray uses a new technique to characterize arbitrary material shaders, while also providing non-interpolated brute force sampling paths for ease-of-use.

The Indirect Diffuse Quality controls the number of samples split out for a diffuse interaction at a material. For the basic default Global Illumination (GI) mode of On, this controls the number of GI rays. In Finalgather (FG) mode, it controls the number of FG rays, as well as the FG point density and other FG controls.

Below as Indirect Diffuse Quality is increased, note the noise on the floor where the light has to reach from reflections off the walls, ceiling and objects.

Indirect Quality 0.2
Indirect Quality 0.6
Indirect Quality 1.0
Indirect Quality 1.0

To see it isolated as we did above with the direct diffuse pass, enable the indirect diffuse pass.

indirect_quality_0.2_indirect_diffuse indirect_quality_0.6_indirect_diffuse indirect_quality_1.0_indirect_diffuse

Diffuse Trace Depth

The Trace Depth controls affect how deep an individual eye sample path can go. The Indirect Diffuse trace depth has moved into the general Trace Depth section. When an eye sample originates from the eye, each interaction along a given path increases the ray traced depth count. The interaction type can identify different types of counts. For example, a Diffuse reflection or transmission counts toward the Diffuse depth, while glossy or specular reflection counts toward Reflection, and glossy or specular transmission counts toward Refraction.

Indirect Diffuse (GI) Mode Off
Indirect Diffuse Depth 0
Indirect Diffuse Depth 2
Indirect Diffuse Depth 2
Indirect Diffuse Depth 4
Indirect Diffuse Depth 4

Note: Currently, a Diffuse value of 0 means that the first indirect diffuse samples are taken, but then no others, when an indirect diffuse mode is enabled. In other words, the act of using an indirect diffuse mode automatically creates the first level in trace depth. However, this diffuse count starts after the first diffuse interaction, not at the eye. Compared to the rest of the depths, this means this number is one less in relative depth to the other interactions for a given eye sample. This matches legacy FG diffuse depth control. But this will be changed in the future to better match the other trace depth controls.

Material Quality is discussed in more detail in the next post on recommended modern materials and lights.