Saturday, June 6, 2009

Introduction to mental ray part - 2
 

one frame to the next need to be redefined. This feature allows mental ray to optimize scene tessellation,

preparation, acceleration data structure management, and network transfers, taking advantage of the time

coherency of the animation.

The functionality of mental ray may be extended through runtime linking of user-supplied C or C++

subroutines, called shaders. This feature can be used to create geometric elements at runtime of the renderer,

procedural textures, including bump and displacement maps, materials, atmosphere and other volume

rendering effects, environments, camera lenses, and light sources. The user has access to a convenient

environment of supporting functions and macros for use in writing shaders. The parameters of a userprovided

shader can be freely chosen with name and type; user-defined shaders are not restricted to a list

of predefined parameters. Available parameter types include integers, scalars, vectors, colors, textures,

light sources, arrays, and nested structures. When a user-defined shader is called, mental ray will provide

parameter values according to standard C calling conventions.

The built-in material shaders provide a rich variety of parameters for describing material properties,

including ambient color, diffuse color, specular color, transmission and shadow colors, a specular exponent,

reflectivity, and transparency coefficients, and an index of refraction. These parameters are interpreted by

the shader specified for thematerial. All material parameters except the index of refractionmay be mapped

with one or more textures. Color textures include opacity information and if multiple textures are applied

to a single parameter they are composited. In addition, one or more bump, displacement, and/or reflection

maps may be associated with a material.

Light passing through the space surrounding objects, as well as light passing through solid objects,

is modified according to volume shaders, which allow the creation of effects such as fog and nonhomogeneous

transparency effects and visible caustics beams. In addition to standard material environment

maps, a global environment map can be specified that provides a solid background for rays leaving the

scene.

mental ray can generate a variety of output formats, including common picture file formats and specialpurpose

formats for depth maps and label channels. Alpha channels and both 8 and 16 bits per component

are supported, as well as a 32-bit floating-point component mode. User-supplied functions can be applied

to the rendered image before it is written to disk.

Contour lines can be placed at discontinuities of depth or surface orientation, between different materials,

or where the color contrast is high. The contour lines are anti-aliased, and there can be several levels of

contours created by reflection or seen through semitransparent materials. The contours can be different

for each material (and some materials can have no contours at all). The color and thickness of the contours

can depend on geometry, position, illumination, material, frame number, and various other parameters.

The resulting image may be output as a pure contour image, a contour image composited onto the regular

image (in raster form in any of the supported formats), or as a PostScript file.

Phenomena consist of one or more cooperating shaders or shader trees (actually, shader DAGs; a DAG is

a directed acyclic graph). A phenomenon consists of an "interface node" that looks exactly like a regular

shader to the outside, and in fact may be a regular shader, but generally it will contain a link to a shader

DAG. mental ray takes care of integrating all aspects of the phenomenon into the scene, whichmay include

the introduction or modification of geometry, introduction of lenses, environments, and compile options,

and other shaders and parameters.

The Phenomenon concept is conceived to unify — by packaging and hiding complexity — all those

seemingly disparate approaches, techniques, and tricks, most notably (but not limited to) the concept of

a shader, which are characteristic for today's state of the art in high-end 3D Animation and in Digital

Special Effects production. The aim is to provide a comprehensive, coherent, and consistent foundation

for the reproduction of all visual phenomena by means of rendering. The Phenomenon concept provides

the missing framework for the completion of the definition of a scene for the purpose of rendering in a

unified manner.

This book describes versions 2.0 and 2.1 of mental ray. Features that are available only in mental ray 2.1

but not in mental ray 2.0 are marked with "2:1".

No comments: