Introducing mental ray for Maya 2016 Render Settings

This is the first in a series of posts on mental ray for Maya 2016 Render Settings

Introduction

We significantly changed the mental ray for Maya 2016 Render Settings User Interface (UI) in order to reduce time spent adjusting renders. The defaults aim for no-fuss rendering of the most frequently used and up-to-date features. Of specific note, our newest Global Illumination (GI) mode significantly increases ease-of-use and productivity.

We provide almost everything a user needs here within this UI. For example, a user should not have to type in string options anymore.

Goals

Members of both NVIDIA ARC and Autodesk, including UI designers and developers, collaborated to make this change significant. As stated in the Maya 2016 documentation for mental ray Render Settings, we aim to:

  • Enable complete rendering without requirement to adjust or enable most settings. The defaults should enable the most frequently used features.
  • Increase ease-of-use when adjusting settings to control for optimization and quality.
  • Provide single global controls to reduce repetitive and potentially error-inducing settings across scene elements.

We also want to retain the flexibility of mental ray for production users. So we provide an Advanced Settings option on each of the new tabs. We hide less frequently used features in favor of a cleaner, more productive and simpler control for basic workflow. This leads users of all levels to what is fundamentally important to control.

Render Settings Tabs

We re-organized the mental ray Render Settings into four main tabs:

The Quality tab contains quality settings for controlling sampling. By using quality settings, instead of sample counts, we take advantage of better optimization schemes internally. We also believe it will be conceptually easier, once the community gets familiar with this style of control.

The Scene tab contains shared settings across scene elements, such as camera settings that should be applied to all renderable cameras. This is where we provide the new simplified mental ray Passes.

The Configuration tab contains settings that are more likely to be used across Maya sessions, and how a user likes to work with the scene. For example, the interactive rendering control for progressive rendering depends on a machine’s resources.

The Diagnostics tab contains settings that help a user with problem solving, or identification of areas for optimization.

Quality Settings

Here, we provide an overview of how to adjust your scenes with the new UI, suggesting our recommended practice.

For new scenes, use the Overall Quality setting in the Sampling section as the primary control for speed vs. quality. It is located at the top of the Quality tab.This controls samples across a scene. Samples are not fixed per pixel. Rather, they vary in density per pixel region. More samples are taken in each region until the quality is matched.

In the next section, we provide detail to better understand how to adjust quality beyond the Overall Quality setting. With better understanding, we hope you can more quickly achieve your desired results. 

Understanding more about quality adjustment

Here, we introduce the concept of global vs. local sampling. This concept is key to adjusting quality now and in the future, as rendering technology evolves.

The Overall Quality setting is a global setting that controls samples across a scene. Each sample starts a ray traced from the camera out into the scene. In essence, we sample the scene from the eye (E). Below, we show an eye ray (in green) over a work by Albrecht Dürer.

durerWhen an eye ray intersects an object, the eye ray may split into several samples. We will call those the local samples, in contrast to the global samples, because they are local to each eye ray. Below, we show a diffuse distribution of local samples split out for diffuse reflection.

eye_rayWe separate the local samples into two categories at an intersection point: the samples used for lights and the samples used for materials.

For materials, the sample directions depend on the type of surface at the intersection point. For example, above a diffuse surface creates samples in the hemisphere above the intersection point. Because these samples tend to hit objects, it represents indirect light.

For lighting, the samples are taken from all visible lights in the scene. Below, we see a single light sample for the same intersection point. There could be more light samples depending on number and size of lights. Light samples represent direct light.

light_rayTraditionally, lights were only those elements specified explicitly as lights in the scene, and they had no size. However, as rendering implementations evolved, so did lights, from point to area lights, and now, emissive objects. Also, consider the light from an environment. Environments convert automatically into light sources by enabling environment light emission. When enabled, we provide a separate quality control for the environment lighting.Note that it is grayed out when not enabled. Furthermore, now one can create such a light more directly. See for example Create > Lights > Environment Image (IBL).

Similarly, we provide a separate control for indirect diffuse (GI) quality in materials, even though it is conceptually a part of material quality.As global illumination techniques have evolved considerably, so have the ways to control these techniques. Yet, the Indirect Diffuse Quality applies to any Indirect Diffuse (GI) Mode selected, and to any material used.

In our next mental ray for Maya 2016 Render Settings post, we provide more details and examples for Adjusting Quality.

Light Path Expressions Improvements in 3ds Max 2016

Starting with iray in 3ds Max 2015 you can render different bits of information into different buffers using Light Path Expressions (LPEs). LPEs are exposed through iray Render Elements.

LPEs are regular expressions that match some light transport paths that iray generates. Each result buffer can be associated with an LPE so that only paths which match the expression end up contributing to that buffer. The iray renderer also allows you to render several buffers with different LPEs at the same time at almost no additional runtime cost. LPEs can distinguish between different surface properties such as diffuse or glossy, reflection or refraction, types of light sources, and names.

In 3ds Max 2016, LPEs have been extended to allow light-specific and object-specific paths.

Light-specific LPEs allow to render your scene per light source. You can then adjust light intensities in a post process, weighing them together.

Object-specific allow to render your scene per object. You can then perform artistic compositing of an image, for example by subtracting an object’s reflection from the beauty image or by adding glow to the image.

For examples of LPE usage, check out these iray blog posts:
Compositing with Light Path Expressions
Instant Relighting & Nonphysical Effects
Get a grip (2): instant color change

Lights and objects need to be grouped into layers before they can be referenced in LPEs.

Below is an example how to achieve this. You can download the example scene from https://s3.amazonaws.com/arcdownload/irayLPESceneUsingLightsAndObjectsHandles.zip.

Open “Tools/Layer Explorer…” to group objects (e.g. the cosmetic box below is under a layer named “container”):


Grouping geometry in the Layer Explorer

The “container” can then be referenced in an LPE "L.*'container'RE" (reflections of the cosmetic box):


Creating an LPE with object-specific path

containerreflectionsRendering "L.*'container'RE"

In the same way lights can be grouped into layer and referenced in an LPE:


Creating an LPE with light-specific path

right_lightRendering "<L'light_right'>.*E"

Hope you will find this post useful.

mental ray for 3ds Max 2016

Here is an overview of the mental ray and iray features which were integrated in 3ds Max 2016.

NVIDIA Material Definition Language (MDL)

The Material Definition Language (MDL) is an NVIDIA initiative to standardize physically based material designs in a common format, see http://www.nvidia.com/MDL. mental ray for 3ds Max 2016 is capable of rendering pre-packaged MDL materials. We will create a dedicated blog post to explain how to enable MDL in 3ds Max 2016.

mdl_examples_3dsmax Rendering MDL with mental ray

Light Importance Sampling (LIS)

The new Light Importance Sampling mechanism in mental ray allows to sample the whole set of lights as if it were one single light, placing more samples on the lights that contribute more to the part of the scene being rendered. It is an importance-driven mechanism that is controlled by a simple set of parameters. Both area and point lights are importance-sampled, and there is no fundamental change required in material and light shaders. This mechanism is typically useful in scenes with many lights, but can be beneficial also in other simpler cases.


Light Importance Sampling parameters

Ambient Occlusion, GPU accelerated

mental ray offers a new, efficient, GPU accelerated “mr Ambient Occlusion” render element.

aomr Ambient Occlusion Render Element

aoparmsmr Ambient Occlusion parameters

The “Max Distance” controls the maximum distance of occlusion probe rays (Note: Value 0 for “Max Distance” means infinite distance). “Falloff” controls how much the occlusion fades out with distance.

Displacement Settings

The mental ray and the iray renderers now offer the “Parametric” approximation method which can help to troubleshoot scenes where the “Length” method exhibits artifacts, for example scenes with very regular and flat geometry. This method is available from the “Render Setup/Renderer” tab and from the “Object Properties/mental ray” tab.


Object Properties/mental ray tab – Displacement Settings

The parametric approximation method regularly subdivides each triangle of the surface. The “Subdivision Level” specifies how many times each input triangle should be subdivided. A higher “Subdivision Level” results in a higher triangle count. Each input triangle is subdivided into 4(Subdivision Level) triangles. Note: there is an internal limit of 8 million triangles per object.

Section Plane

The iray renderer offers a new helper object “iray Section”. The “iray Section” behaves similarly to the “Grid” helper and is used to cut off the geometry in the rendered image. Section planes can either cut off the geometry completely (so let the light in), or let the viewer take a peek inside, see “Clip Light” parameter. You can define up to 8 section planes.

sectionplaneiray Section Plane Helper

Texture Compression

The iray “Texture Compression” can save around 75% of texture memory on both CPU and GPU. This is enabled by default. See http://blog.irayrender.com/post/54506874080/saving-on-texture-memory for details, the level of compression exposed in 3ds Max 2016 is the “medium”.

texturecompressionTexture Compression parameters

Light Path Expressions Improvements

Light Path Expressions (LPEs) for iray have been extended to allow light-specific and object-specific paths.

Lights and objects need to be grouped into layers before they can be referenced in LPEs.

We will create a dedicated blogpost to explain this mechanism.

Irradiance Render Element

The iray renderer offers a new Render Element “iray: Irradiance”:

irradianceRender Element “iray: Irradiance”

irradiance_parmsIrradiance parameters

It is recommended to turn off tone mapping when computing irradiance. By default the irradiance buffer is converted to a heatmap, displaying the lux (or footcandle) values with false colors:

irradiance_bufferRendering Irradiance with heatmap on

Auxiliary Buffers Render Elements: Alpha, Normal, Depth

The iray renderer also offers auxiliary buffers Render Elements (Alpha, Normal and Depth):

auxiliaryAuxiliary buffers Render Elements

auxiliary_buffersRendering Auxiliary buffers

Here is for the tour of the new mental ray and iray features integrated in 3ds Max 2016.

Hope you will find this useful.

Pascal

mental ray for Maya 2016

In this post, we introduce the newest features of the mental ray for Maya 2016 plugin that is delivered with Autodesk Maya 2016 and can be downloaded here. Stay tuned for more in-depth posts on the features.

Render Settings Redesign

This version comes with a complete new layout of the Render Settings. Our goal is to make the rendering experience with mental ray straight forward and easy. Settings are greatly simplified and grouped together. Five tabs allow to find settings sorted by topic. For advanced users, each tab provides the ‘Advanced Settings’ mode with more detailed controls to fine-tune the rendering.

newRenderSettings

The Scene tab contains a simplified render passes system for standard utility passes

newRenderStandardPasses

as well as MILA Light Path and Matte Pass passes.

newRenderMilaPasses

A more throrough introduction to the new Render Settings will follow shortly.

NVIDIA Material Definition Language

mental ray 3.13 renders materials defined by the NVIDIA Material Definition Language (MDL). MDL is an NVIDIA initiative to standardize physically based material designs in a common format, see http://www.nvidia.com/MDL. Prepackaged MDL materials can be applied in mental ray for Maya 2016. We will provide you with an introduction on how to use MDL in Maya 2016 and with examples for download in this blog soon.

mdl-spheres

Light Importance Sampling By Default

Light Importance Sampling is now enabled by default. It gives a significant speed / quality advantage out of the box especially with modern and complex lighting setups, emissive objects, and very many light sources. In addition, new heuristics have been incorporated that automatically determine which light sources in the scene are physically plausible and would benefit from importance sampling. This way, traditional idealized light sources and simple lighting setups can be detected and handled separately, like they may be excluded from importance sampling to retain an overall benefit even though this feature is generally enabled. Custom light shaders are fully supported and will be included in importance sampling if they adhere to physically plausible emission and distribution rules.

Deep OpenEXR

mental ray 3.13 adds support for generating ‘deep’ data and output to OpenEXR files. The resulting image is saved in the DeepTile form of the OpenEXR 2.0 file format, storing additional information of the pixel colors along the Z axis. It is possible to save deep and simple 2D data into different frame buffers during the same rendering.

UV Tiles Optimized

Rendering UV-tiled textures is faster and more memory efficient in this version because it is based on a native mental ray shader. It auto-creates and loads the tile textures into mental ray on demand, making sure that only those tiles that are actually accessed get loaded into memory. The shader is part of a new package called coreutil, which collects essential mental ray utilities and helper functions.

Create Lights menu 

There is a new section in the Create|Lights menu for mental ray lights showing modern mental ray lights in a prominent and easily accessible place.

createLightMenu

Object Lights

Using custom geometry to light your scene is now possible with mental ray for Maya 2016. You can assign the new ‘Object Light’ material to your geometry or, with the geometry selected, you can choose ‘Object Light’ from the new mental ray section in the Create|Lights menu. This will turn your geometry into a light.

 light_bulb_cropped

                           Light bulb model courtesy of David Hackett.

Rendering Bifrost with mental ray

Bifröst is a procedural framework that can create simulated effects ranging from liquid to foam, bubbles, spray and mist. These effects can be rendered using the bifrost geometry shader delivered with mental ray for Maya 2016.

Autodesk published videos on bifrost and showing mental ray rendering at the end of each:

Maya 2016: Adaptive Aero Solver in Bifrost
Maya 2016: Guided Simulations in Bifrost
Maya 2016: Adaptive Foam in Bifrost

XGen hair shading and displacement

Rendering XGen with mental ray has been improved and enhanced with new features.

The default XGen hair shader for mental ray is now xgen_hair_physical. It is based on the mental ray human hair shader mib_illum_hair_x which has been improved with mental ray 3.13. It now adds contributions from indirect lighting to the shading. New parameters have been added to tune the tube shading look and to control the internal color noise effect.

Displacing sphere and dart primitives is now possible allowing for a much wider use-case for these primitives.

xgen-spheres-with-displacement

Texture Filtering based on Ray-Differentials

For advanced ‘elliptical’ texture filtering in Maya’s file node, we are now using ray differentials provided by mental ray core. This introduces more accurate and artifact-free texture filtering even across ray traced reflections and refractions.
To enable it, select a file node, choose ‘Mipmap’ as filtertype, go to the mental ray section and enable ‘Elliptical filtering’. You can choose between ‘Bilinear’ or ‘Bicubic’ filter mode.

Troubleshooting mental ray renders of Maya XGen

Got a nice XGen groom? Everything looks decent in VP2, but in your mental ray renders parts of the hair are missing or, even worse, the hair is not rendered at all?
Don’t panic, these issues can be addressed.

Hair geometry shader setup

In mental ray, XGen hair and other procedurals like cards or randomly instanced archives are handled by a geometry shader. This geometry shader needs to be set up correctly. Usually, this is done automatically by Maya when a new XGen description is being created. In some cases it can happen though, that the geometry shader gets lost or has not been applied. As a result, the XGen primitives are not rendered. To reapply the shader, open the preview/output tab of the XGen window and click the “Setup” button to the right of  “Setup Geo Shaders” in the output settings section:

xgen-setup-geo
After that, your XGen description should render.

Adjusting render output settings

In case your hair looks clipped or thinned-out in a rendering, pay attention to the render output settings. One important setting that usually needs to be adjusted manually is the area, that is supposed to contain all generated XGen primitives. By default, this area is computed from the the bounding box of the XGen base mesh,  plus a padding value of 1 for the XGen primitives.  This padding value is suitable for fitting a default XGen description with hair of length 1. Real-world grooms rarely meet this condition, that’s why renders come out with clipped hair.

To change the padding, open the preview/output tab of the XGen window and click the “Auto Set” button beneath “Primitive Bound” in the output settings section to compute a proper padding-value:

xgen-primitive-bound

This ensures that all hair (or whatever primitives you are working with) is being rendered correctly.
As you groom along, the padding value might need to be re-adjusted, again.

In case the hair appears less dense in the rendering than in the viewport, make sure the “Percent” slider has been set to 100:

xgen-percentage

A lower value will cause the number of generated primitives to be reduced accordingly. This slider can be a nice tool to get fast preview renders with fewer primitives.

Batch rendering XGen primitives

For batch rendering, one additional step is necessary. The XGen collections used in your scene need to be exported to disk to ensure that mental ray can find them. To do so, click on File -> Export Patches for Batch Render in the XGen window:

xgen-batch

Happy hair rendering,
Sandra

New version of Alembic import shader

Here’s a new version of the abcimport shader that is compatible with mental ray 3.12 and mental ray for Maya 2015. It can be downloaded from this link. The package contains a version for Windows, Linux and Mac OS X, as well as the .mi file with the new shader declaration.

The new features:

  • Support for hair import
    Alembic curve objects are translated into mental ray hair geometry. The curves can be defined with linear segments, quadratic bezier and cubic b-spline (either uniform or with given knot vector). Hair approximation quality can be set with the shader parameter “subdivisions”  (default 0). The parameter controls the number of subdivisions for hair segments. The picture shows a rendering of an Alembic file generated by Ornatrix 3, with linear hair segments and using the shader “mib_illum_hair_x”.hair from abcimport                                                                         Hair alembic file courtesy Ephere Inc
  • Faceset material support
    In Maya, the facesets are assigned with material names. Our abcimport shader now uses this information to reference materials with these names. Facesets can be either triangle or polygon mesh. (Facesets for subdivision surfaces will be added later.) Faceset translation is enabled by default and can be turned off by setting the shader parameter “facesetmaterials” to off.
  • User data support
    Triangle meshes now can reference user data such as color3, color4, point, normal, float, integer. The user data must be attached as “arbitrary geometry parameter property” to objects in the abc file. Please, contact us for more details.
  • Subdivision control for hair, NURBS and subdivision surfaces
    The “subdivision” parameter is now also applied to hair, NURBS trim curves, NURBS, and subdivision surfaces.
  • Motion blur issues fixed
    Motion blur for topology changing abc files is now possible. We fixed an issue with the velocities in Alembic which were not interpreted correctly.

These features will be incorporated into the upcoming versions of mental ray this year.

mental ray – In the Lab

This is the first post of a new category: NVIDIA mental ray – In the Lab. We want to give peeks into research projects and features we are working on for future versions of mental ray. Here we like to talk about our GPU accelerated Ambient Occlusion solution, in short: AO GPU.

The video demonstrates three new features of AO GPU: Progressive Rendering, High Quality Anti-Aliasing and Object Instancing. It was generated using a standalone test application, using a NVIDIA Quadro K6000 GPU.

Progressive Rendering

Previously, AO GPU used a sampling mode optimized for batch rendering. This sampling scheme, based on Fibonacci numbers, converges very fast and efficiently to good results. The caveat is that you have to know the number of samples in advance, plus there are only certain sample numbers you are allowed to use (1, 2, 3, 5, 8, 13, …). If you stop rendering ‘in-between’, the image will look wrong.

Now, sometimes you are not sure how many samples are needed to achieve the desired quality. The usual solution is to perform progressive rendering, which means watching intermediate rendering results and stop the render process when quality is good enough. As you can see in the video, Fibonacci sampling is not suited for progressive rendering, intermediate images show strange wobbling shadow effects (we moved the camera to trigger a re-rendering in the application). Switching to our new progressive sampling scheme fixes the wobbling artifacts, you just see the noise disappearing over time.

This progressive sampling scheme does not converge as fast but it is well suited for ‘time-constrained’ situations, where you want to stop rendering after a certain time limit, and you are not sure what the best sample count setting would be.

High Quality Anti-Aliasing

The existing AO GPU solution used a very simple anti-aliasing scheme to filter pixel jaggies at geometric edges. Essentially, this filtering was constrained to the area of a single pixel, and every sample was equally weighted. Of course, for some scenes this simple Box filtering is not good enough. In the video, we magnified a detail of such a scene to show the problem. Look at the dark vertical gap between the doors of the cupboard; it looks staggered even with many anti-aliasing samples.

We added new filters to improve this. Anti-aliasing now samples in larger area than only a single pixel, and the samples are weighted according to a filter curve. In the video, we switch to a special Gauss filter curve with a sampling area of 3 pixels diameter, and you should see that the lines look much better now. Other available filter curves are ‘Triangle’ and ‘Gauss’.

Object Instancing

For complex scenes, memory consumption is always a concern. The model shown in the video has 21 million triangles, using about 3 GBytes of GPU memory. If we want to render more objects, then we might lose GPU acceleration, because additional models do not fit anymore into GPU memory. The current AO GPU solution will switch to CPU rendering automatically, but rendering will take much longer. If the additional objects consist of the same model, then the model can be reused in the rendering without taking much more memory. This model-replication technique is called instancing.

We implemented instancing in the AO GPU prototype to see how far we can get with this technique on a GPU. As the video shows, a million replicas are no problem.

We hope you enjoyed reading this post and watching the video.