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.

About David

I am a VFX artist that specializes in Lighting and Rendering. I spend a fair amount of my time supplying clients with artistic solutions as well as technology solutions. With a background in fine art and technical animation training, I strive to bridge the divide between the artist and technologist.

Posted on January 22, 2013, in Example, shaders, Uncategorized and tagged , , , , . Bookmark the permalink. 71 Comments.

  1. Excellent post as always. Very detailed. As soon as I get a free moment I will be testing this awesome new workflow! Thanks for all the effort in getting solid info out there about this.

  2. Do these shaders minimize the need for using mia_env_blur to speed up glossy reflections, or do glossy reflections still tax render times as much as mia_material’s gloss?

    • These should perform better, as the image shows it goes to a complete diffuse shading. With better range and better sampling. But as the post says: use area light sources! The ability to use the envblur remains.

  3. Hi and thank you for the post! I’m registered to the forum but I can’t access the discussion: how can I try this shader?

  4. On the mila_layer node would it be possible to get a slot to alter the extinction coefficient for the fresnel mode? It’s already in the formula so why not expose a control to alter the number from the UI?

  5. Hi, I’m having problems with MILA in Maya 2013 SP2 running on MAC OS 10.7.5, I configured as requested scene!

    // Error: *Fatal* (mental ray) : mental ray encountered a fatal error. The system may have become unstable. Please save the scene and exit Maya. //
    // Error: (Mayatomr.Output) : failed during mental ray rendering: mental ray abort //

    Does anyone have any idea what is happening?

  6. All sounds very interesting and I am glad the Nvidia is taking MentalRay forward it deserves to TLC.

  7. I redid the installation again and got a scene that had run in Win7. I know it’s a big log but here is it:

    Maya.2013: JOB 0.6 16 MB progr: 20.3% rendered on henrik.home.6
    Maya.2013: PHEN 0.4 16 MB info : MILA:fb mayaGlow has index 0
    Maya.2013: PHEN 0.4 16 MB info : MILA:fb mayaColor has index 1
    Maya.2013: PHEN 0.4 16 MB info : MILA: mila_mix connected to mila_material
    Maya.2013: JOB 0.6 16 MB progr: 20.6% rendered on henrik.home.6
    Maya.2013: PHEN 0.4 16 MB info : MILA: mila_mix querying requirements for 1 layers
    Maya.2013: PHEN 0.4 16 MB info : MILA: mila_diffuse_reflection connected to mila_mix
    Maya.2013: PHEN 0.4 16 MB info : Light scale = 3.14159
    Maya.2013: PHEN 0.4 16 MB info : MILA: mila_mix init done
    Maya.2013: PHEN 0.4 16 MB info : MILA:fb mayaGlow has index 0
    Maya.2013: PHEN 0.4 16 MB info : MILA:fb mayaColor has index 1
    Maya.2013: PHEN 0.4 16 MB info : MILA: allocated 18 standard fb outputs
    Maya.2013: dyld: lazy symbol binding failed: Symbol not found: __Z11primary_rayP7miState
    Maya.2013: Referenced from: /Applications/Autodesk/maya2013/mentalray/shaders/layering.dylib
    Maya.2013: Expected in: flat namespace
    Maya.2013: dyld: Symbol not found: __Z11primary_rayP7miState
    Maya.2013: Referenced from: /Applications/Autodesk/maya2013/mentalray/shaders/layering.dylib
    Maya.2013: Expected in: flat namespace
    apple.launchd.peruser.502: ([0x0-0x38038].com.autodesk.Maya.2013[447]) Job appears to have crashed: Trace/BPT trap: 5
    ReportCrash: Saved crash report for Maya[447] version Maya 2013 (2013) to /Users/henrik/Library/Logs/DiagnosticReports/Maya_2013-01-24-151211_Henrik.crash
    Maya.2013: mental ray for Maya 2013
    Maya.2013: mental ray: version 3.10.1.11, Jul 25 2012, revision 177995

    • Possible compile problem, we saw it on Linux. It’s reported, they can take a look at it from the Betas where someone mentioned it.

    • Yeah, definitely report all bugs to Nvidia directly (possibly on the layering shader forum thread). We’re not Nvidia representatives!

  8. Thanks very much for the info, David. Very helpful.

    I fear that mental images/Nvidia has no idea what their users keep telling them, which is, things need to be SIMPLER. Not complexer. We went from base shaders to dgs/dielectric, to mia to mia_x.. to mia_x with passes (really? Couldn’t you have just extend the original ones), to 8 types of misss shaders to 8 types of bssrdf. (I don’t even wanna start on how bad the AETemplates were written for those).. to now MILA shaders. All of them have yet to work properly with Maya’s render passes however obscured the system already is.

    I’m a tech artist and I love all this tech stuff, but even I go.. “Christ.. Can’t you just make something that works with EVERYTHING with ONE button press?”.. It really IS possible!!.. Can’t we just extend/improve existing shaders instead of adding new ones AGAIN with other problems?

    The only thing that got simpler is Unified Sampling.. And that hasn’t even been officially build in yet.

    I say this totally knowing that this whole thing is in beta. But it would suite MI to simplify things a bit and hire some new AETemplate scripters 🙂

    I’m just saying.. I’m not trying to shoot the messenger.. I’m hoping the messenger can return the information to infect the hive 😀

    • Well I think you might be confusing a few things here. Remember, MI (actually now nVidia) is not in charge of integration. This is Autodesk’s job to take what is provided and integrate it. So you’re looking to the wrong people to make changes. 😉

      The evolution of the mia_material was to make them compatible with how Autodesk evolved Maya. The exposure of the older mia_material nodes were because Autodesk decided to do that. Customers using the old shaders clung to them and did not want to update. This is the same with the Lambert and Blinn shaders. Autodesk was unwilling to remove them from the UI for fear users would freak out. And they are correct, users are already complaining about new ways of doing things. But what they don’t understand is that after the initial shock, they will come to embrace the new shaders and methods of lighting because it will be easier and look better.

      MILA doesn’t work with the Maya system currently because they are not integrated. Maya’s framebuffers are written by Autodesk, so there’s no reason to expect these will work with Maya as-is. Over time we are hoping to improve how the framebuffer system works in Maya to make this easier.

      The MILA shaders have two purposes when it comes to usage for most users:
      1. Phenomenized shader library for quick selection of appropriate shaders like: skin, glass, car paint, solid glossy, etc. This means you won’t be using the MILA components directly. Part of the Beta is to address this.
      2. The components are available when someone needs to make something not offered for a special effect. They can then Phenominize it if they would like to keep it.

      This is the flexibility seasoned user desire. So this model offers both.

      The Beta is also addressing the AEtemplate issue where users now have direct ways to think about and work on these shaders. You will see them evolve as time goes on.

    • As for a one button press, you lose some things, like flexibility and control. In most of those cases your render time increases (see: Arnold) in favor of “easy”

      But then we hear, “It’s so slow!” You can’t currently have both. One is sacrificed for the other. So nVidia is trying to bridge this divide by giving users a continuum of choices from simplicity to complexity based on what the user wants.

  9. MILA support only maya?
    can be part of mr. pack for other 3d software?

    • It’s designed to work with mental ray specifically. But testing can be done from inside an OEM package with the knowledge that there may be problems resulting from non-integration.

  10. Hi David!

    I’ve added the “mila glossy samples” to my enjoyMentalRayStringOptions script.
    Is there any other mila string options? If yes, where can I find them? 🙂

    Thanks in advance!

    Regards,

    Dorian

    • Hi Narann! They are listed in the documents. However, most are for diagnostic purposes so I wouldn’t expose them. The glossy samples is really the only one for quality control right now.

      • They are listed in the documents. << I've search and didn't find the document you are referring on. ^^'

        enjoyMentalRayStringOptions is aim to be a "nice" way to deal with string options. Actually, I just want to expose every string options that can be used with mental ray. 🙂

      • The documents are in the package from the ARC forum for Beta testing. Since you’re a member you can download them. It’s in the “common” folder. But they cannot be re-distributed outside the forum.

        We actually don’t want all controls exposed because it means artists get confused and turn things on and off without realizing what they mean. This causes frustration and the inevitable “mental ray is difficult”. So in keeping with good practice, we expose the necessary controls only and leave others for more advanced users.

      • I was aware it was in beta but not aware about the redistribution. I will wait for “official” string options before add them. 🙂

    • Just keep in mind that these shaders are Beta and that any string options are likely to change (including “mila glossy samples”!)

  11. I think most raytracers including vray are losing the fight against Arnold ,and sorry but Arnold its faster than mental,lots of studios are jumping on Arnold.

    • They both have their strong points. But the point of this blog is to explain mental ray in a way that lets users operate it correctly and easily. Rather than spend thousands on licences of something else, they can use this blog as a guide to get the results they didn’t know were possible with the software they already own.

      The user must understand how to operate the software to get the most benefit/performance when it involves more choices. And that goes back to the reason for the blog. Many users suffer slow render times and frustration because they do not have a good non-technical source for knowledge on rendering with mental ray. It’s our experience, that when used correctly, we can consistently match or beat performance expectations on complex scenes.

  12. Hi. Could you tell me how to express the spectral fresnel curves for gold that end at white for grazing angles? See http://www.raytracing.co.uk/?p=17

    From what I have seen, you can’t. What I am suggesting is that the “normal reflectivity” and “grazing reflectivity” parameters of the schlick fresnel falloff need to be colors rather than scalars.

    Is there hope of incorporating this?

    Thanks

    • For now a great deal of that effect can be visually achieved through IOR. Maxwell Renderer documents that you can omit K and use a different IOR with the same visual effect (and it is a spectral renderer) As noted in the article you cite, “Implementing physically-based metals was an interesting experiment, although the overall effect is quite subtle.”

      However, the Material Description Language (MDL) that these are based on does have the ability to add a measured curve. It’s been discussed that this might be useful in MILA. The thought is, the reason to expose K is to better mimic a real metal. But using a provided curve is simpler and more direct so that would be the preferred solution.

      It’s not high priority I don’t think since high IOR values have a pretty good visual resemblance for most CG work. But it is on the roadmap for the future. 🙂

      • For my purposes I need to be able to express dielectrics and colored metals on the same texture. All I need for this to work is to be able to pass a color (texture) to the Shlick normal reflectivity. I’m not as interested in complex IORs or measured curves.

        Currently I use the tint parameter to tint the specular layer, but obviously that does not result in a white reflection at grazing angles.

        Is there any chance those reflectivity parameters could be changed to colors rather than scalars?

      • You can always make the suggestion in the Beta Forum for the developers to see.

        It’s possible they have a different alternative in MDL.

      • As David mentioned, you should post all suggestions to the Beta forum…

        A) Yes, ARC is considering the best way to implement complex IOR effects.
        B) weight_tint already gives you an indirect handle for this effect. You would have to write your own “fresnel utility” that returns a color.
        C) “I’m not as interested in complex IORs or measured curves.” But this is what you are asking for…
        D) “Currently I use the tint parameter to tint the specular layer, but obviously that does not result in a white reflection at grazing angles.” Keep in mind that weight_tint is a weight, not a color. For instance, setting weight_tint red will cause sub layers to be more heavily weighted green-blue.

  13. hi guys, I´m wondering if you can help me with this problem:

    I´m testing the mila layer shaders in maya 2014, and I´m having some issues, I can´t get / mix the mila_glossy_reflection contribution with other layers, for example:

    with a sphere with a mila_material with mila_layer, I plugged a mila_diffuse_reflection node in the 0 slot.
    then I plugged a mila_glossy_reflection in the slot 1, but I can´t see the reflection contribution in renders, the reflection is visible only if I turn off the diffuse layer of the 0 slot, the same happens if I add an scatter node before the glossy_reflection layer.

    what I´m doing wrong?

    you can check the material at this scene:

    https://dl.dropboxusercontent.com/u/41696972/mila_reflection_test.ma

    Thanks in advance

    JC

    • Sounds like your layering is reversed for one. The top layer gets the most energy in a layer node. If you are not using a directional mode then that layer gets all the energy and you don’t see what’s underneath. Also, if you want to see glossy or specular reflection on top of the diffuse reflection, they need to be above it in the layer node.

  14. What is the correct way to use the Adapter Shader ? The documentation mentions you can use any non-milA shader. I want to connect an AO shader to the Adapter shader then to the MilA shader connection, so far in doing so I’ve either crashed the 3D app or it failed to work.

    • Diffuse reflection has the ability to use a similar technique with the diffuse detail option. Why are you using a AO shader? Maybe there’s a better way.

      • diffuse detail option, you referring to Maya ?
        The AO shader gives me the control I want, do you have any suggestions ? 🙂

      • MILA itself has this ability. It is more accurate than occlusion and includes a distance parameter. This is explained on the ARC forum, are you a member there?

  15. ARC Forum, is that an Acronym for the nVidia Forum ?

  16. Yup it is an Acronym for the forum I originally thought it was.
    To answer your question, yes I am a member.
    You don’t happen to have a link to that discussion ?

  17. Hi,

    I’m impressed by the amount of information here and the support you offer in your blog… I feel your enthousiasme and it’s contagious… I would like to test MILA as any geek would like to test a new gear… maybe I will contribute in debug efforts too… the only issue is that I don’t have access to the forum and I tried to register again and all but I’m still restricted for an unknown reason from most ARC forum… so I can’t download anything (my nickname is eagleeyez) if anyone can help from the admins who probably visit this great blog too.

    • You need to make a post on the forum in one of the MILA threads asking for access and explaining who you are/how you use mental ray (so they’re sure you’re not a robot) and then in a day or tow you should be approved for seeing the development forum.

  18. Hi awesome guide but how can one use reflectionmaps with some control on the min and max values for your reflection based on the mapping. aka ramp->remap color for the output min and max values based on the inserted reflectionmap image? I guess you put it in roughness because the others reflections (normal and grazing) are angle based but it doesn’t work. With the mia’s you put it in reflectivity, but how do you get that to work in a mila?

    • Reflectivity in Mia is a weight for Reflectivity. For the mila material it’s the same, it attaches to the weight of the layer or mix.

      • So basically the weight -> ramp -> remap color -> rfl. mapping then goes into the weight?
        I thought the weight functioned as just a mask on what was visible and what was not. I’ll try it out, thanks for the quick reply.

      • Weight is how much of an effect is visible.

        In the mia_material the weight of the reflection is basically how reflective something is.

        The same is true if you alter the weight of a component in the material. If my glossy reflection weight is altered, then it’s the same effect, how much glossy reflectivity is visible.

      • I am replying again because the result is not what what I meant. Just to be clear I have a comparisson of what I mean using a MIA and what results I get if I use the roughness (I also tried the suggested weight value but it results the same).

        You can see the comparison here; http://i.imgur.com/vmh4t7t.png

      • Even with that image I’m not sure where the problem is. Glossiness = inverted roughness. This doesn’t have anything to do with the weight. Only the blurriness of the result. Weight is the same as “reflectivity” in the MIA material if applied to the layer with the reflection component.

        IOR is if you were to select “use ior” in the MIA material. Or you can use the custom curve which is the same as the Schlick curve in the MIA material default.

        Remember if you are not inverting your values for roughness from glossy, it won’t be what you expect since now 1.0 = completely rough or nearly diffuse reflection. I cannot duplicate where using the same map in reflectivity weight matches using it in roughness. However, you might be interpreting the more linear curve of roughness as diffuse reflection where it’s really completely rough glossy reflection.

      • This is (below) reflectivity mapped to a sphere with mia and another mapped to weight of the mila material. The results are basically identical. The difference in intensity is because it’s a different reflection model.

        You can see here that mapping to reflectivity and the weight of a reflective component is basically the same.

        https://db.tt/DmC7lbml

  19. Quoting this because it isnt allowing me a direct reply:

    >>This is (below) reflectivity mapped to a sphere with mia and another mapped to weight of the mila material. The results are basically identical. The difference in intensity is because it’s a different reflection model.

    >>You can see here that mapping to reflectivity and the weight of a reflective component is basically the same.

    >>https://db.tt/DmC7lbml

    I did some testing; the roughness works but not if you use the following.
    If for example I already had a luminence node with my remap color and then my reflection map and a DRAG it from my hypershade into the attribute editor mid mouse on the roughness then it doesn’t work and doesn’t show in the render.
    To make it work though, I removed the luminence node. Clicked on the roughness checker thing to add a new luminence node to it and then dragged my remap color into that new node mid mouse. Then suddenly it does work and show what I needed. My co worker tried it with the same results.

    I guess this was the problem I had yesterday because I had already set it up for a weight layer and so instead of removing nodes and reconstructing it I dragged it into what I also requiered thus enabling this “bug” I guess.

    I hope they fix this soon, thanks for your patience and explanations I finally feel like I get it now 😉

    • I will add that this also happened with a normal file node, dragging in an already existing one from the hypershade doesn’t make it show up but when creating it from the attribute editor it does.

    • You might want to report any UI errors you have. I will look on my end too. The official mental ray blog would also like to hear if there’s an error in the MILA for Maya post.

  20. HI David,

    I am having a huge problem with Maya. I am trying to get an SSS shader to work with a highly reflective material in Mental Ray to make a bronze or copper material with it. The closest I have gotten is using the Mila material but for some reason the Mila material doesn’t want to work with an image node to mask out the areas I do not want the shiny material to show. It only works with default nodes like checker or fractal for some reason. Any advice would be appreciated. I already tried the color mixer and the fast SSS fast skin shader but then I lose the scatter with this method although I like the scatter results better with this shader. This also only works with non file nodes also. I think it has to do with light linking.

    I would add a picture but I don’t think there is an option to insert an image. I ho[e you can help. Thanks!

  21. what about mila_adapter in maya2016 ?
    connecting the result of mia_x to mila_adapter then the mila_adapter to mila_layer return error “user” not found in mila.py

  1. Pingback: nVidia Material Description Language (MDL) « elemental ray

  2. Pingback: Using Framebuffers with the Layering Library (MILA) « elemental ray

  3. Pingback: Andrew Hazelden's Blog » Exploring the new Mental Ray MILA Layering Library

  4. Pingback: MILA updates | elemental ray

  5. Pingback: MILA New Features – May | elemental ray

  6. Pingback: The Layering Library (MILA) Part 1 | elemental ray

  7. Pingback: The Layering Library (MILA) UI: BETA SHADERS | CGNCollect

Leave a comment