home << prev next >> contents  


Materials

A material determines the response of a surface to illumination. Materials in mental ray consist of a material name and one mandatory and seven optional shaders, each of which can be a standard shader or a user-provided C/C++ shader:

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.

home << prev next >> contents  


Copyright © 1986-2007 by mental images GmbH