Search Results for MILA

MILA tip and trick – Dispersion *updated with Phenomenon*

One of the features artists have asked for is the ability to do dispersion inside mental ray without needing a custom shader.

The Material Definition Language contains such an effect but before this is available in mental ray, you can use MILA to create a reasonable approximation.

Unexposed in the main UI is an option for “weight tint” that is a luminance you can control inside a mila_mix or mila_layer node to get the effect. Slightly offsetting the ior of the transmission nodes is what controls the spread of the dispersion effect.

I will update this post again when I have a useful phenomenon to provide to make this simpler, but in the meantime you might come up with your own experiments. Updated below.

MILA Dispersion Phenomenon (3 Bands)

MILA Dispersion Phenomenon (6 color)

MILA Dispersion Phenomenon (6 bands)

You can find the three band (color) phenomenon here. (Copy and paste if your browser doesn’t download the file. Place in your “include” folder for mental ray shaders)

The phenomenon exposes the following controls for the user as a transmission-only component. You can layer this with other components manually by connecting it through the hypershade. The incarnation of MILA in Maya right now isn’t setup to use custom phenomenon flexibly just yet. By altering the phenomenon you can include other controls. For example you can add a tint control instead of having only colorless transmission. Or for nicer looking dispersion you can create six bands instead of the three in this version (Think ROYGBIV).

You can see the power here of Phenomenon and MILA. You can create and store constructs and expose the controls you want for yourself or others. Using the conventions outlined in the MILA documents you can continue to build complex materials with all the benefits of importance sampling and light sharing.

MILA Dispersion Phenomenon, simple 3 band transmission

MILA Dispersion Phenomenon, simple 3 band transmission

Happy exploring!

MILA Dispersion using Specular Transmission

MILA Dispersion using Specular Transmission

*hint: if you find the result is a little “green” (assuming you have connected this as RGB) then you can reduce the ray cutoff to solve it. It’s not always necessary and is based on the model. The link to the string options for MILA are HERE. Eventually such controls will be exposed in the UI natively.

MILA Material - mixed specular transmission

MILA Material – mixed specular transmission

MILA Mix node for simple transmissive dispersion

MILA Mix node for simple transmissive dispersion

 

The Layering Library (MILA) Part 2

In this post we will go over the material properties and base phenomenon (layers) of the MILA material.

Part 1 can be found here and the Inside mental ray blog post can be found here.

The default layout of the MILA material is designed to give the user access to the most common selections. There are four sections (top to bottom):

  • Components – this is where you add and see components created as mixes or layers (covered later)
  • Base – the base acts as the main bottom layer of the material and as a storage space for built-in presets (covered here)
  • Material Properties – overall controls for the material that apply to everything (covered here)
  • Extra Attributes – you can add additional named framebuffers here for output when the material is run. You can find more information on this here. (Covered previously and re-linked at the bottom of this post)
Car courtesy of Holger (Kzin) rendered in Softimage

Car courtesy of Holger (Kzin) rendered in Softimage

I will begin with Material Properties:

Material Properties (MILA)

Material Properties (MILA)

Visibility was known previously as “cutout opacity” and lets the user cutout or remove parts of the geometry completely. This is a scalar control and expects a range from 0.0 (invisible) to 1.0 (opaque). The blue sphere in this image has a checker connected to the visibility.

visibility_mila

 

Thin-walled allows you to create a shell of a material where rays are not refracted. This would resemble a hollow object. The top image is solid, the lower is thin-walled (on).

Solid Sphere

Solid Sphere

Thin Sphere

Thin Sphere

Show Framebuffer – allows you to render the material with the selected framebuffer into the beauty. This can be enumerated for an easier UI selection if you desire. You can find this information in the documentation.

Overall Bump applies a bump to all the layers contained in the material. Otherwise you can add the bump manually per layer for specific effects. This will be most common. Side note: A bug was found before release that causes the bump in MILA to generate negative pixel values. This was fixed but Maya was already frozen. A next release will solve the issue.

Next is the Base section.

DIFFUSE BASES

Diffuse bases are often a mix with another component. You can see the control for “Diffuse Weight” where 1.0 = diffuse tint result. As you decrease this, the result becomes more scatter, translucency, etc. based on your chosen base. This is because most usage scenarios will want at least some diffuse mixed together with the result to be more realistic and/or faster. In the mia_material you had a weight for the diffuse color. This is a similar control. Without additional layering you can create:

  • paper
  • wood
  • dry clay
  • dirt
  • simple SSS (no glossy/specular reflection on top)
  • rust
  • etc.

REFLECTIVE BASES

Reflective bases often have a glossines blend that mixes with a diffuse base component and shares the same color (with the exception of plastic and paint). Reducing the blend to 0.0 removes the glossy or specular reflectivity to reveal a diffuse base. Without additional layering you can create:

  • plastics
  • metals
  • brushed metals
  • leathers
  • etc.

TRANSMISSIVE BASES

Transmissive bases are often glossy or specular reflection layered on top of a transmissive base component (these lack a diffuse component as it is unnecessary). Reducing the reflective weight does what you’d expect, it reduces the glossy or specular reflectivity. Without added layering you can create:

  • glass
  • frosted glass
  • liquids
  • etc.

In all of the above cases where IOR is present, you can leave the weights at 1.0 and use the IOR as a physical directionally weighted energy control. This is similar to “use ior” in the mia_material under the BRDF controls. Common settings:

  • 1.33 – water
  • 1.5 – glass
  • 4.0-6.0 plastic
  • 20.0 and higher – metals
  • You can find other ior values here listed as nList of Refractive Indices

This replaces the Schlick control curve the mia_material had but is simple. The custom Schlick Curve is present when layering above a base (covered later)

Base material rollout

Base material rollout

This rollout gives you the usual bases most artists would start with before adding a layer on top. You may or may not need more than what the base provides. When you first create a MILA material the Base defaults to “Diffuse” which as you might expect is like a Lambert shader with a Roughness parameter to create something like Oren-Nayer roughness. Beneath this is a Contribution section for direct and indirect (non-physical) scaling discussed near the bottom in the previous section.

Contribution: What’s an example of direct and indirect weighting?

Indirect will only render indirect sources of light, that is, light that has reached the object through interaction with other objects. Direct will only render direct source of light to the object. Keep in mind an object light has a duality where it’s both an indirect and direct object. In the future this may not be the case.

Below are renders with a chrome ball and environment light inside a box with a hole. The box is hidden. Top is indirect only so the walls are rendered in the ball. Bottom is direct only so that only the light source (IBL) is shown in the ball. Adding the results gives you the complete render with both contributions. This is also how the MILA native framebuffers for direct and indirect operate so you can scale this in 2D post.

Indirect contribution only

Indirect contribution only

Direct contribution only

Direct contribution only

Direct and Indirect results added together

Direct and Indirect results added together

Below is each setting and a brief description. I will skip over the first one, diffuse.

Diffuse (scatter) base. This is a combination of a scatter and a diffuse material. These are mixed together with a diffuse weight so that you can mix in a little diffuse with your scatter. The scatter and diffuse tint are shared. More details over the scatter shader will follow but are the same types of controls found in SSS2 shaders provided in previous Maya releases. This time the scatter component does not generate a lightmap and instead uses a caching mechanism on the fly that is multi-threaded.

Notice in the below render that the scatter spreads as the color chosen in the front and back scatter options. The scatter is based on the RGB choice in the color swatch that is a color modifer (different than the scatter node if layered elsewhere). This is a simplified mode of scatter. In the scatter node itself each channel (R, G, or B) spreads based on the amount each represents. For example: RGB of 10 5 2 means red scatters 10, green scatters 5, and blue scatters 2. Red will be the predominant color since it scatters further than the others. Remember to use physical settings in rendering, including correct Final Gather choices or you may have artifacts.

Diffuse (scatter) base

Diffuse (scatter) base

 

Diffuse (translucent) can be seen here with diffuse weight set to 0.0. It’s a good example for things like thin blades of grass, paper, etc. The sphere here is flattened some and a cylinder is put through it and backlit. Diffuse transmission is best suited for thin/2D objects. Be sure and use correct physical Final Gather settings for best results. Correct indirect lighting will be important in using these and future materials.

Diffuse Translucent

Diffuse Translucent

Reflective mixes a diffuse layer with a glossy overcoat. A simple weight is used to blend them.

Reflective

 

Reflective Anisotropic adds anisotropy control.

Reflective Plastic adds a fresnel control for the reflection amount and removes the anisotropic control.

Reflection Plastic (with a bit higher roughness than the previous reflection base)

Reflection Plastic (with a bit higher roughness than the previous reflection base)

Reflective Paint emulates a car paint-like base without the top clear coats that would be added through layering. Here I have tweaked a few settings and changed the diffuse tint to red. Notice the Flakes parameter now has multiple noise options for rendering including Cellular noise patterns and circular style flakes where you can alter their size. This paint will be physically correct, unlike the paint material option previously used for mental ray.

The paint material has quite a few options and operates somewhat differently than the old car paint material. This will be worth a post on its own like the scatter node at some point. I have also attached a render from Holger (“Kzin” on many forums) showing a car paint phenomenon using MILA in Softimage.

Reflective Paint default settings

Reflective Paint default settings

 

Reflective Paint (tweaked)

Reflective Paint (tweaked)

Carpaint Examples (from "Kzin")

Carpaint Examples (from “Kzin”) Click for larger version

Transmissive is a basic glass material for solid objects with a roughness parameter that’s tied together along with the ior for reflection and transmission.

Transmissive

Transmissive Clear removes roughness from the controls and makes for simple glass-dielectric shading.

Transmissive Clear

Transmissive Clear

Transmissive Distance is like Transmissive but adds a control for distance falloff. This allows the control of rays as they travel through the medium. Lots of times artists use this to create deeper colors or things like colored liquids similar to cola. Here there is a little roughness and a light blue falloff that looks deeper blue with the distance reduced.

 

Transmissive Distance (tinted blue)

Transmissive Distance (tinted blue)

 

Extra Attributes are as described previously in the MILA Framebuffers post as well as the MILA updates with an example. Below you can see that the Extra Color buffer can be written even if not primarily visible to the camera. This means mattes in reflection and refraction can be written out for easier color correction in 2D.

Headlamp with lens cover

Headlamp with lens cover

Amber material matte generated through a rayswitch

Amber material matte generated through a rayswitch

Amber Shader matte (color buffer) output

Amber Shader matte (color buffer) output

Turn indicator with glint!

Turn indicator with glint!

The next post on MILA will go into Layering details including the concepts behind mix vs layer, energy conservation, and organizing the layout.

 

 

The Layering Library (MILA) Part 1

In Maya 2015, the Layering Library (MILA as we will call it) was integrated for use. This is an initial integration and will evolve through advancements and feedback.

Part One will discuss some basics before getting to the UI inside Maya.

You can find other details on the Official mental ray blog with Bart’s first post on MILA.

betterTrees

Why MILA? Isn’t the MIA (Architectural) material good enough?

Artists have noticed when using the MIA (Architectural) material that complexity adds render time. In fact, the more you layer and tweak the MIA material, the worse it can get on an exponential level. The MIA material would spawn rays to sample the scene at a high rate even if it was a third or fourth level of trace depth. When layering the MIA material, each layer would complete the entire job of shooting rays and sampling lights before combining output, even if that work wasn’t visible in the final result.

The MILA material avoids this. It uses better techniques to reduce work done by the renderer. This means layering the material or using high trace depth has less (or no) impact on the render time or quality. This is important for better and easier realism in an image.

The MIA material also had a few features that users have decided they didn’t like or were rarely used. The glossy reflection curve had a drastic change near the 0. point, making it hard to paint textures for. The interpolated reflections weren’t used often and required tuning. And other features like tuning reflection rays weren’t always intuitive.

MILA moves towards a “roughness” parameter for glossiness that is more linear and easier to texture. It also has a more accurate glossy reflection model. Rarely used settings or “tricks” were removed in favor of straightforward operation. And in keeping with the mental ray shift in usability, simple Quality controls are used to tune the result of the material instead of tweaking numbers. The Quality controls also understand the settings in the material itself and attempt to self-adjust for better renders from the beginning.

Why component based?

Many times an artist would want to add a simple reflection layer or maybe some dirt to a MIA material. This meant adding a completely new monolithic material on top for a single and simple job.

Component based selections mean effects or interactions can be added as necessary.

MILA also follows the design of the Material Definition Language (MDL). Coming in mental ray 3.13, the MILA materials will lead towards this rendering workflow.

Anisotropic MDL model

 

Understanding concepts and terms.

In using MILA there are a couple things to talk about. Before getting into the actual components, there are types of interactions to think about. This will make creating a material easier to understand later.

Reflection versus Transmission

-Reflection is a ray that strikes the material and bounces off. This can be the traditional “reflection” we’re used to as well as diffuse reflection where light strikes and comes off an object back into the scene. This lets us see the reflected light from the object(s). A specular or mirror-like reflection is easy to understand. Diffuse reflection is the same thing but the light reflected back is diffused (not sharp). So the concept is the same in graphics.

-Transmission is when a ray passes through an object. This is traditionally noted as something like “refraction” but covers all types of transmission. Diffuse transmission is commonly known as translucency.

The names of the components and the direction of the energy (ray) can be described visually using the image below:

From the docs. ® nVidia

From the docs. ® nVidia

Why these names?

As mentioned above, the move to MDL makes for renderer agnostic materials. Using these names also helps associate with Light Path Expressions (LPE) which are also renderer agnostic. For example, “reflection” can mean a lot of things to different renderers. But “diffuse reflection” is specific.

Direct versus Indirect

-Direct effects are a result of light directly affecting the material. The light path is from the light to the material with nothing in between.

-Indirect effects are a result of light that has interacted with something else before reaching the object.

Components have these names in their description to help you choose the effect you need:

MILA Components Menu

MILA Components Menu

More details can be found in the previous post about the Beta testing of the Layering Library. Integration has changed the UI and the workflow. That process will follow in the next parts of the blog.

On to part 2 with explanations on the Base components and more.

 

 

MILA New Features – May

As the MILA shaders evolve, features will be updated here when possible. These shaders are inspired by the Material Description Language and you can find more on that from the GTC conference here: nVidia Material Definition Language for Coordinating Materials (Thanks to Saycon for the link in the comments)

This latest release includes some more user-inspired changes like:

  • A non-physical global clamp for reflection to eliminate hotspots (fireflies) from lights and interreflections
  • Independent direct and indirect contribution sliders on components to create non-physical but art driven look
  • Further moving of controls to global Quality String Options both for all MILA Quality as well as specific controls like “mila glossy quality” etc.
  • Continued work on the Quality controls adaptability meaning fewer tweaks, just set the shader look and hit render
  • Creating a Diffuse Reflection Detail Quality to replace Ambient Occlusion controls
  • Moving controls off the shader components to make them clean and easy, a move toward greater simplicity for mental ray (to be continued)
  • The elimination of unused or infrequently used controls
  • *experimental* propagation of additional buffers in secondary rays

Clamp

The clamp option can be used as on or off (default is off) for controlling overbright highlights and reflections. It is a non-physical effect. This means it purposefully changes the energy in the render to avoid artifacts from insufficient sampling. This is usually caused by a very hot HDRI used to light a scene or a bright area light and the resulting indirect reflections.

This clamp option may also reduce render times because fewer samples are taken to resolve hotspots that cause variance in the image. The below image had an HDRI with a high value of over 7000 for the sun. Rendered at Quality 0.20 for Unified Sampling to amplify the effect of poor sampling. This also affects the resulting framebuffer contribution. Notice the areas that are not overly hot are maintained.

Clamp off and on

Clamp off and on

Direct and Indirect Contribution

A direct and indirect slider can be used to change the look of the material non-physically. Recall that Direct Reflection is the result of the light. Indirect Reflection is the result of the light from other objects in your scene. The easiest way to think of this is the direct diffuse is historically your diffuse pass and indirect diffuse is the indirect pass or “color bleed” from nearby objects reflecting light and measured by something like Final Gathering.

Below is an example with the effect of direct at 0.00 contribution and then indirect at 0.00 contribution on glossy reflection. You can adjust these independently to achieve a non-physical but pleasing artistic look in a material. This will also affect the resulting framebuffer contribution. These can be texture mapped as well for special effects.

Direct and Indirect scale comparison

Direct and Indirect scale comparison

Diffuse Indirect Detail

Diffuse Indirect Detail replaces the Ambient Occlusion controls with an On and Off switch globally, a distance parameter, and quality. Below is an example of on and off at default values.

Diffuse Detail on and off (animation)

Diffuse Detail on and off (animation)

Framebuffer Indirect Contribution Writing

*experimental* Additional buffers can now be rendered as seen in a reflection or refraction (indirect). This means you can get the matte color of an object written to its own buffer even if it is only seen in a reflected or transmitted ray. Below is an example where the turn blinker (indicator) writes its resulting color matte to the framebuffer despite being behind the lens cover of the light. It also contains information where it was reflected as well. This is useful to isolate and alter elements after rendering.

Headlamp with lens cover

Headlamp with lens cover

Amber Shader matte (color buffer) output

Amber Shader matte (color buffer) output

You can also pass the matte through another node like a rayswitch to further define the mattes generated through transmission (blue) or reflection (red) as seen below.

Amber material matte generated through a rayswitch

Amber material matte generated through a rayswitch

Now apply Glint!

Turn indicator with glint

Turn indicator with glint

Keep in mind that this object would be “baked” into the transmission framebuffer derived from the beauty. So changes after rendering would still be limited. This may also increase the render time as an extra color framebuffer is considered for anti-aliasing. If you wish to avoid that you can turn off “contrast all buffers” in the Quality Tab -> Framebuffer Rollout of your Render Settings.

Overall the goals for MILA are continued flexibility and simplicity based on MDL. Redundant and unused controls are moved and clarity in settings is being improved.

Why all of the “Quality” Controls?

Also notice the increase in controls for “Quality”. This is important since the underlying method or algorithm can be hidden under a simple control. This is already true of Unified Sampling and the Native IBL.

Why is this useful?

By hiding the method, developers can later change or improve it without introducing new controls or altering the old ones. This was true of the refinements made in Unified Sampling in 3.10. Artists can continue to work as the renderer improves without learning new techniques.

This is part of how mental ray will continue to simplify the workflow for users without sacrificing flexibility or speed. This will also make the integration of new features much easier in OEM products like Autodesk Maya since documentation and UI changes will be unnecessary with added improvements to existing features.