*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.

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.

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.

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.

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.

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

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)

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)

: turn this layer on or off (participate in rendering) Weight : simple scalar value to decide how much weight or energy absorption this layer has

: 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

: as above but using a color value, this can tint the result returned by the shader component Use Directional Weight: w ith the feature off, the resulting component has no fresnel or directional falloff curve. The effect is applied evenly over the surface.

ith 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

: 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)

: 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 below mila_mix example has two components added to the node.

Shader : accepts a component, other mix, or layer node

: accepts a component, other mix, or layer node On/Off : turn this layer on or off (participate in rendering)

: turn this layer on or off (participate in rendering) Weight : simple scalar value to decide how much weight or energy absorption this layer has

: 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

: 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.

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

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

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.

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.

: 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.

: 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’ 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).

: 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.

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.

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

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

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.

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.

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.

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.

NEXT: How to create framebuffers for MILA inside Maya.