Materials
A material determines the response of a
surface to illumination. Materials in
mental ray consist of a material name and one mandatory and several optional
shaders, each of which can be a standard shader or a user-provided C/C++
shader:
-
The primary shader is the material shader
itself. This is the only one that may not be omitted in case no
BRDF is specified. The material shader
determines the color of a point on an object, based on its parameters which
may include object colors, textures, lists of light sources, and other
arbitrary parameters.
-
An optional volume shader controls rays
passing through the inside of the object. This is functionally equivalent to
atmosphere calculations, but takes place inside objects, not outside.
-
An optional photon shader determines how
the material interacts with indirect
illumination if caustics or
global illumination are enabled, much like
the main material shader determines how
the material interacts with direct illumination.
-
An optional photon volume shader determines
how the inside of the object interacts with
indirect illumination if
caustics or
global illumination are enabled, much like
the volume shader determines how the
volume interacts with direct illumination.
-
An optional environment shader provides an
environment map for non-raytraced reflections.
-
An optional displacement shader can be named
that displaces any type of surface
geometry at each point in the direction of the normal. Displacement maps
affect the triangles resulting from the tessellation of
free-form surfaces,
polygonal meshes,
and subdivision surfaces.
-
An optional shadow shader determines the
way shadow rays pass through the object. This can be used for calculating
effects like colored shadows.
-
An optional contour shader specifies how
contours should be drawn in and around the object that this material is
applied to, if contour rendering is
enabled.
-
An optional lightmap shader causes the
object to be sampled to create a light map,
which collects arbitrary information (usually illumination) about an object
that can later be used during rendering.
-
An optional BRDF shader as a replacement or
fallback for any material or photon shader in the material. This allows
advanced rendering algorithms to take advantage of known shading properties
provided by a single BRDF.
The shading function may be either a user written function
linked at run time, or it may be one of the standard functions.
Shaders may define parameters that control their behavior. Shaders
are completely free to define any set of parameters required for
their function, but there is a set of commonly used terms and
parameter names that will be found in many parameter lists.
Parameters have names and values. The declaration of a
shader, which is provided by the author of the shader, defines the
list of possible parameters, including names and types (such as
"color" or "vector"). The definition of a shader is done in
a scene file, and provides the values. For example, a shader might
have a color parameter named "diffuse" with the value
1.0 1.0 0.0, which specifies a yellow color. Parameter
values can be given in any order. Parameters can also be omitted;
mental ray will substitute null values. Shaders are typically
programmed to provide reasonable defaults in this case.
BRDF/BSDF
A Bidirectional Reflection Distribution Function
(BRDF) is a common model in computer graphics to describe
illumination characteristics of a material. A Bidirectional
Scattering Distribution Function (BSDF) is an extension of a
BRDF with transmission properties like refraction added to the model, and used
in mental ray as the basis for its internal representation.
A BRDF can provide additional information to the renderer compared to
conventional shaders normally used in materials. As a benefit, these
functions typically adhere to physical or mathematical constraints. This
knowledge can be essential to improve rendering efficiency. On the other
hand, a BRDF does not offer the same flexibility as a material shader.
However, this flexibility is not needed for the majority of rendering
applications, but the performance costs associated with "black box" shading
can be avoided in those cases.
The current implementation allows rendering algorithms to take advantage of
specified BRDFs as needed, or still support fully programmable shading.
mental ray provides a set of built-in BRDF shaders
for common shading models. They are exposed as built-in shaders which can be
attached to materials slots like regular material or photon shaders. For
advanced rendering algorithms like
irradiance particles a BRDF should be
attached to the bsdf
slot of a
material description.
MDL Materials 3.13
The NVIDIA
Material Definition Language, or MDL, is a formal
specification to describe material designs that comprise all properties
relevant for a realistic visualization and physically accurate appearance.
That includes the base appearance like color and texture of the surface, the
reflection and refraction behavior, absorption and scattering effects of
volumetric parts, emissive properties, down to geometric detail from bump,
normal, or displacement maps. The underlying shading models are strictly
based on BSDF descriptions, and any combinations of
them that do not break physics.
The MDL materials are typically provided in files of type .mdl
.
Often, they are part of a larger catalog, which delivers many variations
of materials. A final MDL material description for use in the renderer may
be built from other base MDL components within the same catalog, which are
ultimately constructed from standard MDL functions and BSDF models
implemented in the MDL-capable rendering engine. A renderer like mental ray
can take advantage of that knowledge about shading properties by applying
certain optimizations, like importance sampling.
The usage and application of MDL materials in a scene is straight forward.
The .mdl
files can be included into a scene like regular shader
declarations. mental ray will create material nodes in the internal scene
database that can be referenced by name in objects and instances in the usual
way. See known limitations for details.
Copyright © 1986, 2015
NVIDIA ARC GmbH. All rights reserved.