Blog Archives

The Layering Library (MILA) UI: BETA SHADERS

*These materials have been released for Maya 2015. The below post applies to the Beta shaders. There have been changes to the materials and SIGNIFICANT changes to how they are presented/integrated inside Maya 2015. Please see the newer posts on these.*

Shaders were previously announced for future beta here and have been released today.

Below are the UIs and brief descriptions of the various parts of the Layering Library known as MILA. More complex examples and Phenomenon© will become later posts. But this should get you started on the basics. The next post will show how to create framebuffers in Maya using the legacy user framebuffer mechanism. Since framebuffers are simply named and built-in, it makes for easy rendering without making connections in Maya.

This library is currently designed as a flexible replacement for (at a minimum) the fast_sss, metalllic paint, car paint, and mia_material shaders. (You should have hopefully abandoned Lambert, Blinn, Phong, etc quite some time ago in mental ray. . .)

This begins the bridge to more modern flexible rendering by following the nVidia Material Definition Language. You may find this a little familiar if you have used the iray layered material.

The image below is rendered from the Unified Sampling post with MILA: glossy reflection, scattering, and diffuse reflection. The lighting is Environment Lighting Mode and final gathering. Depth of Field and image rendered brute force with Unified Sampling.

MILA multi-threaded scattering at work

MILA multi-threaded scattering at work

The shaders introduce several important things:

  • Built-in framebuffers handled by the root node.
  • Better importance sampling
  • Improved glossy reflection with a default linear curve
  • Scattering node that no longer uses a pre-process or lightmapping phase and is multi-threaded
  • Default physical correctness and energy conservation (without the emission node) regardless of layering/mixing
  • Shared light loops that improve performance when layering shaders
  • Framebuffers that provide a mathematically correct workflow in compositing by outputting additive passes
  • Framebuffers that introduce you to the Light Path Expression grammar and concepts
  • Correct lighting scale without need for 1/pi multiplication with modern lighting like the user_ibl_env and the Native IBL
  • etc.

Why use MILA? Beyond their forward looking design there are some more logical reasons to use these shaders.

These shaders free the developer and artist in a few different ways.

For developers using the MILA API, you can create your own components to share in the framework. This means you can create and update a component at a time. By building phenomenon from the networks, your updates and additions can be made immediately available without coding and compiling multiple monolithic shaders. Debugging individual pieces can also be easier and faster before creating a phenomenon.

For artists it introduces better performance, more flexibility, and a workflow designed for future shading and lighting. While all the components may seem tedious to begin setting up in Maya, these can be Phenomenized easily. This means shaders can be used and shared as Phenomenon over and over again with a simplified UI. For example: opaque objects do not require shaders with controls like “refraction” or “translucency”. You can greatly reduce the control set and expose what you need, even setting your own defaults for specific materials to re-use later. (Some useful Phenomenon come with the package)

Caveats in Maya for the Beta:

  • These are not integrated shaders by Autodesk as yet, these are as-is
  • Maya does not automatically connect Shadow and Photon shaders to the mila_material node
  • Components make their own unnecessary Shading Group at creation. They are easily removed by using “Delete Unused Shaders” from the Hypershade menu
  • Some convenient global features like per-component samples rely on String Options (found in the miDefaultOptions and explained here)
  • The automatic creation of the UI from the node factory (.mi files) may have errors, these need to be discovered during the Beta
  • Shader updates may break previous scenes saved with MILA shaders
  • Use area lights for lighting!

Some of the above problems can be solved through UI creation with mel. As part of the Beta, you can collaborate on useful AEtemplate and presets for the nodes.

The main components of the node follow a familiar pattern for those of you used to either the DGS material or iray.

From the docs. © nVidia

From the docs. © nVidia

Diffuse Reflection and Transmission

Glossy Reflection and Transmission

Specular Reflection and Transmission

(Scattering is handled separately as well as emission)

Below is an example from the documents on a possible layering scenario at two levels. Keep in mind that layering and mix nodes can also be plugged into one another. This makes layering easier when you need to combine effects or re-use networks you have already built as part of another network.

A one-level layered network from the docs. © nVidia

A two-level layered network from the docs. © nVidia

As I explain some components I assume a familiarity with the mia_material as some of those settings and concepts are repeated here. So instead I will touch on things that have changed or are new.

The mila_material node: This is the root node of the network.

mila_material root without added buffers

mila_material root without added buffers

  • Visibility: this is like the “cutout opacity” of the mia_material

The top shader connection is meant for a layer or mix node explained below.

This contains the built-in framebuffers and a way to expose them at render time by showing them in the primary buffer using the “Show Framebuffer” integer. In Maya this can be enumerated in the .mi file to make the UI more intuitive.

The additional “Extra” framebuffers can be specified here to run other shaders and utilities when the shader is executed. An example would be an Extra Color for a label or ID pass used in compositing.

The mila_layer node: Used to layer components, other layer nodes, and mix nodes together.

Fresnel weighting of diffuse colors

Fresnel weighting of diffuse colors

Below is the default empty node with the familiar “Thin Walled” parameter from the mia_material

The default Layering Node

The default Layering Node

The below example has a single top layer added. Each new layer added is beneath the previous layer when it is rendered. (Top – down design)

Multiple layers with different weights and selective bump mapping applied.

Multiple layers with different weights and selective bump mapping applied.

Adding unbumped reflection makes the components below appear encased.

Adding unbumped reflection makes the components below appear encased.

The Layering node with a layer added to the top.

The Layering node with a layer added to the top.

  • Shader: for adding a component such as mila_glossy_reflection, layer, or mix node
  • On/Off: turn this layer on or off (participate in rendering)
  • Weight: simple scalar value to decide how much weight or energy absorption this layer has
  • Weight Tint: as above but using a color value, this can tint the result returned by the shader component
  • Use Directional Weight: with the feature off, the resulting component has no fresnel or directional falloff curve. The effect is applied evenly over the surface.
  • Fresnel Mode: this mode uses Ior to control the curve used for the component effect, this is familiar from the mia_material “use fresnel” switch
  • Custom Mode:  this is used to apply a Schlick curve that can be manually changed on the shader, this is familair from the mia_material (opportunity to hide/expose the control based on a mel selection of Directional Weight Mode)
  • Bump: per component bump applications, for now in Maya you need to use the Connection Editor since drag and drop or regular connection from the menu fails to work. Maya expects a shader for a bump node and not a vector so it gets confused.

The mila_mix node: Used to simply mix components together. Rather than think of a top -> down approach as in layering, think of simply mixing two paints together. Red and Blue make Purple for example.

Below is the default empty node with the same “Thin Walled” option as well as a way to change the energy conservation to a clamp mode.

The default Mix node

The default Mix node

The below mila_mix example has two components added to the node.

The Mix node with 2 added components to mix

The Mix node with 2 added components to mix

  • Shader: accepts a component, other mix, or layer node
  • On/Off: turn this layer on or off (participate in rendering)
  • Weight: simple scalar value to decide how much weight or energy absorption this layer has
  • Weight Tint: as above but using a color value, this can tint the result returned by the shader component
  • Bump: per component bump applications, for now in Maya you need to use the Connection Editor since drag and drop or regular connection from the menu fails to work. Maya expects a shader for a bump node and not a vector so it gets confused.

The mila_diffuse_reflection node: this is the Lambertian (or Oren-Nayer using roughness) node that is very similar to the mia_material.

There is an added feature, the Rgb Bump vector. This is used to quickly simulate a sub-surface scattering effect when a bump is applied to a diffuse surface. This is not useful without a bump effect applied to the shader in the layer or mix node. This allows colors to be applied to a bump in varying degrees and therefor simulating an inexpensive and shallow scattering effect.

Diffuse reflection, Lambert and Oren-Nayer style diffuse scattering

Diffuse reflection, Lambert and Oren-Nayer style diffuse scattering

The mila_diffuse_transmission node: this is a simple node used for translucency effects.

Diffuse transmission, different shades of grey utilizing 'thin walled'

Diffuse transmission, different shades of grey utilizing ‘thin walled’

There is an indirect multiplier node for controlling indirect interactions such as final gathering

Diffuse Transmission is Translucency

Diffuse Transmission is Translucency

The mila_glossy_reflection node: this is the glossy (blurry or rough) reflection node. This node has received quite a bit of attention and should get a lot of testing to further improve it through feedback.

Glossy reflection with varying roughness.

Glossy reflection with varying roughness.

Glossy Reflection, blurry or rough reflection. Default curve is linear.

Glossy Reflection, blurry or rough reflection. Default curve is linear.

Things to notice that are different than the mia_material:

  • Roughness: this is the amount of blur for the reflection. 0.0 is a mirror-like reflection while 1.0 is diffuse reflection. This is a visually linear curve and the direct reflections now match the indirect reflections, unlike the reflection and specular (direct reflection) response of the mia_material that was originally preferred by artists. Lower ray counts for brute force no longer result in a darker reflection like mia_material. Energy is conserved correctly.
  • Samples: this parameter means the same things as the mia_material but you’ll notice that now 0 samples means ‘take the samples amount from the global string option’ “mila glossy samples” instead of mirror. This is a convenient setting that exists across the shaders so you have one location for setting samples. This is important to simplify rendering and using Unified Sampling. Individual shaders can still be tuned individually if necessary.
  • Visible Area Highlight: an inexpensive application of multiple importance sampling. -1 is the recommended default and allows the shader to choose whether to sample lights indirectly (reflection ray) or a light directly (light sampling). 0.0 is indirect reflection only. 1.0 is direct reflection only. Amounts in-between are mixtures of the schemes. As the roughness increases, so does the possible contribution of direct light sampling. If your area light has insufficient samples or Unified Quality isn’t high enough, these areas will exhibit grain. Using the framebuffers will help you decide where the noise is coming from (indirect or direct glossy reflection).
  • Roughness Exponent: allows the user to change the curve of the glossy parameter from visually linear to something else that might be useful. You may find the amount of 1.5 to be most useful but some testing will help determine the best default for final release.

Important to note: this shader actually performs best with an area light. Spot, point, and directional lights all have zero area to sample and are less intuitive to use when mimicking traditional lighting from the real world. Take a look at the Area Lights 101 post for more ways to simplify and speed up your renders. In the examples here I am using a disc area light with no decay. From the point of interest I aligned it with the sun in the HDR which is also a Native IBL that is emitting light on “automatic” mode.

The mila_glossy_transmission node: this is the glossy (blurry or rough) refraction node. The parameters are similar to above but include ior to refract (bend) rays passing through the object.

Glossy refraction using the same ior of 1.55

Glossy refraction using the same ior of 1.55

Glossy Transmission is blurry or rough refraction

Glossy Transmission is blurry or rough refraction

The mila_specular_reflection node: This node is simply a mirror reflection. It shoots a single ray and can be colored.

Important to note here: this shader is indirect reflection only. This will not generate a highlight for invisible or infinitely small (point) lights. If the light itself must be visible, you must use something that is visible to reflection with an actual size or area such as the user_ibl_rectangle or an area light.

Specular reflection node with various shades of grey tint.

Specular reflection node with various shades of grey tint.

Specular reflection: mirrored, non-glossy surfaces

Specular reflection: mirrored, non-glossy surfaces

The mila_specular_transmission node: Same as above but refracts rays through the object. There is no option to blur the result.

Specular transmission attenuated by grey color to black.

Specular transmission attenuated by grey color to black.

Specular Transmission is for non-glossy refraction

Specular Transmission is for non-glossy refraction

The mila_scatter node: this is the multi-threaded (no lightmap) sub-surface shader. These parameters mean essentially the same thing as the SSS2 shader found in the current documents and Maya 2013. If you are familiar with the new SSS2, then this shader should be simple to control

Subsurface scattering with the front weight attenuated through grey tint

Subsurface scattering with the front weight attenuated through grey tint

The Scattering or SSS node with tinted orange scatter. White is also acceptable/preferred tint to start with.

The Scattering or SSS node with tinted orange scatter. White is also acceptable/preferred tint to start with.

  • Resolution: this is a control that sets the amount of detail the shader will capture in screen space. 2 is the default and means half resolution. 1 is same resolution as render and 0 is double the resolution. Higher numbers decrease the resolution accordingly.

The mila_transparency node: this is simple colored transparency.

This can be layered to create cutout-like effects and transparency in simple cases where ior is not required. But you may find the “thin walled” option in the layering node to be more appropriate.

Simple transparency

Simple transparency

The mila_emission node: this is similar to the “additional color” of the mia_material or incandescence in other materials. It’s simple to use but does not emit light as an object light. Final gather will sample the object as an emitter.

Emission shades of grey multiplied by 2.0 in the shader

Emission shades of grey multiplied by 2.0 in the shader

Emission is for glowing objects (not specifically light emitting, but a fake)

Emission is for glowing objects (not specifically light emitting, but a fake)

The mila_get_roughness node: This utility is so you can use maps painted for the mia_material glossiness inside the mila_glossy nodes without major modification.

A helper to use older maps painted for mia_material glossiness inside MILA

A helper to use older maps painted for mia_material glossiness inside MILA

The mila_get_normal node: this is used to get and alter the normal for bump maps.

This is not needed in Maya. You can manually connect a Maya bump node to the layer or mix node with the connection editor. This node is needed in 3ds Max.

An adapter for bump mapping, not required in Maya, the native bump node works with the help of the connection editor

An adapter for bump mapping, not required in Maya, the native bump node works with the help of the connection editor

NEXT: How to create framebuffers for MILA inside Maya.

The Layering Library (MILA shaders)

If you head over to the NVIDIA-ARC forum, you’ll see a beginning explanation developer thread to testing the Layering Library. This thread will continue to expand. (You must be a registered forum user. Also, the forum does not recognize users automatically for spam reasons, you need to participate by making a post at some point. This also prevents Bots from swarming the board. Once the shader package is linked you may be able to make a post and download it.)

You can participate there and come back to the blog time to time to see other examples and explanations on the shader library.

These shaders begin the transition to other modern techniques with a flexible selection of components. The features include (but not a complete list):

  • Built-in framebuffer outputs
  • Better importance sampling for faster renders
  • Components as separate building blocks for arbitrary layering. A single library can make shaders for many different things from car paint to skin and more.
  • Non-lightmapping scattering shaders (multi-threaded)
  • Light Path Expression options for specifying framebuffer passes
  • Layers maintain energy conservation without user interaction
  • and more. . .

You’ll also notice a re-branding continuing on the site. The main website address is now: http://www.nvidia-arc.com

They are looking for images to use on the main banner, you can even try your hand at some images with the new shaders!

SIGGRAPH Presentation

You can find the presentation here:  nVidia Advanced Rendering and Ray tracing

You can also find a short blurb about coming features here: ARC Forum SIGGRAPH recap

Mentioned are features such as:

  • Ambient Occlusion on the GPU with mental ray
  • Layered shaders (layered components) that include the SSS shader without lightmapping. They have their own framebuffer mechanism with passes for added flexibility in OEM packages.
  • Object lights with a new shader independent of OEM integrations
  • Light Importance Sampling (IS) and Material Importance Sampling. This makes the usage of objects as area lights much easier and faster than before
  • Multiple Motion Transforms (think curved paths and light streaks)
  • Light Path Expressions (LPE) in iray
  • Kepler support for iray 3 in mental ray

 

 

New Maya Rendering UI Testing!

After some careful thought and a lot of tedious work by developers Brenton and Corey (mental core), you can find a Maya Render Settings UI for testing. Barton Gawboy is project management. The purpose of this UI is to provide a more official/intended workflow for mental ray. This also means makers of UIs for other packages can use this as a template for features on modern mental ray (3.10 and future).

This UI is in an early phase and should not be used for production. Currently the Quality settings have been re-worked to provide a simpler interface and a modern workflow for using mental ray in Maya. Over time we will be improving on this (light and passes tabs to be re-worked) and adding documentation. We recommend Maya 2013 SP1.

You can find the scripts on the Google Code page: Maya Render Settings UI

A further discussion can be found on the ARC forum (must be a member): Maya Options UI