In mental ray, a shader is a function that calculates light effects. There can be shaders for lights, cameras (lens shaders), materials, shadows, and so on.
Note: In 3D modeling, the more common usage of “shader” signifies an algorithm that specifies how a surface responds to light. (The shaders for standard Autodesk VIZ fall into this category.) With the mental ray renderer, “shader” has a more general sense of any algorithm used in rendering.
The mental ray renderer can render most types of Autodesk VIZ materials and maps. See Autodesk VIZ Materials in mental ray Renderings. In addition, if you have enabled mental ray extensions (see mental ray Preferences), you can apply a variety of shaders to materials. Materials designed for use with the mental ray renderer have specific components to which you can assign a shader. And for standard Autodesk VIZ material types, the mental ray Connection rollout lets you add mental ray shading.
Warning: When you use the scanline renderer, mental ray shaders typically appear as black or white surfaces, or they are ignored entirely.
You assign a mental ray shader the same way you do a map. In the Material/Map Browser, mental ray shaders appear with a yellow icon, instead of the green icon used for maps.
The shaders listed in the Browser depend on which type of shader component you have chosen in the Material Editor. For example, when you assign a Surface shader, the Browser lists a variety of shaders and standard Autodesk VIZ maps. But when you assign a more special-purpose Contour shader, the Browser lists only those shaders that generate contour lines.
Note: Other kinds of special-purpose shaders include shaders for cameras and lights. Buttons to assign camera shaders are found on the Render Scene dialog's Camera Effects rollout, and the buttons to assign light shaders are on a light object's mental ray Light Shader rollout (which appears only on the Modify panel, not the Create panel).
The shaders listed in the Browser come from several libraries that are provided with Autodesk VIZ. Shaders created specifically for Autodesk VIZ are described in this document. Shaders provided with the mental images or lume shader libraries have their own online documentation. The following topics link to the descriptions of specific shaders:
Custom Shaders for Autodesk VIZ links to descriptions of the shaders provided in the product-specific library, 3dsmax.mi.
mental images Shader Libraries links to descriptions of the shaders provided in the three standard mental ray libraries from mental images: base.mi, contour.mi, and physics.mi.
Shaders in the LumeTools Collection includes links to descriptions of shaders in the lume library, lume.mi.
The Car Paint material is also available as a shader, with the same set of parameters.
The mr Sun, mr Sky, and mr Physical Sky shaders are components of the mental ray Sun & Sky solution.
Note: When you wire the parameters of an object whose material has mental ray shaders assigned, names of shader parameters might differ from those in the Material Editor interface. Also, parameters not supported by Autodesk VIZ might appear as blanks in the wiring menu.
If your installation includes shader libraries other than those listed in this reference (whether obtained from a third-party source, or custom written), then the Browser might list those shaders as well. Documentation for third-party or custom shaders should come from the shader's provider.
Shaders provided with Autodesk VIZ are installed in the subdirectory \mentalray\shaders_standard\, below the Autodesk VIZ root directory. The \include folder is for the MI include files, and the \shaders folder is for the DLLs.
Third-party shaders should not be installed in \shaders_standard. They should be installed either in \shaders_3rdparty or \shaders_autoload. If a third-party shader is present in \shaders_autoload, it is loaded automatically when you start Autodesk VIZ. If a third-party shader is present in \shaders_3rdparty, you must update the file 3rdparty.mi so it explicitly loads the shader. The MI file \shaders_3rdparty\3rdparty.mi contains comments that explain how to add load statements.
Note: Shaders listed in the MI file are loaded in reverse order: that is, from the bottom of the list to the top.