Next: Mantra
Up: How Many Shader Types
Previous: RenderMan
  Contents
Mental Ray
- Material Shaders are maybe the most important shader
type in mental ray. They are called whenever a visible ray
(eye ray, reflected ray, refracted ray, or transparency ray) hits an
object.
- Volume Shaders may be attached to the camera or to a
material. They accept an input color that they are expected to
modify to account for the distance the ray travelled through a
volume.
- Light Shaders are called from other shaders by sampling
a light or directly if a ray hits a source.
- Shadow Shaders are called instead of material shaders
when a shadow ray intersects with an object. Shadow rays are cast by
light sources to determine visibility of an illuminated object.
- Environment Shaders provide a color for rays that leave
the scene entirely, and for rays that would exceed the trace depth
limit.
- Photon Shaders are used in the photon tracing phase to
compute the photon maps that are used to simulate caustics and
global illumination.
- Photon Volume Shaders are similar to photon shaders in
the same way that volume shaders are similar to material shaders:
they compute indirect light interactions in volumes, such as volume
scattering.
- Photon Emitter Shaders are used in the photon tracing
phase to control the emission of photons from the light sources.
- Texture Shaders are called exclusively by other shaders
to relieve other shaders, such as material or environment shaders,
from performing color and other computations.
- Displacement Shaders are called during tessellation of
polygonal or free-form surface geometry. Whenever the tessellator
introduces or copies a vertex, the displacement shader is called and
expected to return a scalar value that tells the tessellator to move
the vertex by this distance along its normal vector.
- Geometry Shaders are functions that procedurally create
geometric objects. It allows mental ray to store small and simple
placeholders in the scene, and generate the objects only when they
are needed, and remove them from the cache when they are no longer
needed.
- Contour Shaders compute contour colors and widths. Any
information about the geometry, illumination, and materials of the
scene can be used.
- Lens Shaders are called when a primary ray is cast by
the camera. They may modify the eye ray's origin and direction to
implement cameras other than the standard pinhole camera, and may
modify the result of the primary ray to implement effects such as
lens flares.
- Output Shaders are called when the entire scene has
been completely rendered. They modify the resulting image or images
to implement special filtering or compositing operations.
- Lightmap Shaders sample the object that the material is
attached to, and compute a map that contains information about the
object. This can be used to bake illumination solutions or store
vertex colors for a hardware game engine.
The source code for a lot of mental ray shaders can be downloaded from
mental images' FTP site:
ftp://ftp.mentalimages.com/pub/shaders/
Next: Mantra
Up: How Many Shader Types
Previous: RenderMan
  Contents
Jan Walter
2004-02-09