Recent developments in high-dynamic-range photography offer a convenient workflow to illuminate a scene just from images taken in a real-world environment. mental ray has built-in support for this type of rendering called image-based lighting, and can compute results of any desired quality which look much more realistic.
"light array"
that allows to
provide a selected list of light instances. The material shader then applies
the illumination from these lights to the shaded
surface, no matter to which object the shader is attached to. To implement
light-object relations independent of the actual material, shaders can also
obtain a list of lights associated with the object instance in the scene
description, known as Light Lists.
The shading function for light sources may be either a user written function
linked at run time, or it may be one of the generic shaders coming with
mental ray. Applications which integrate mental ray may provide custom
light shaders to define the intended rendering behavior.
Some shaders accept a boolean parameter shadow that turns shadow casting on or off for that light source, and a floating point factor that is the shadow factor. The shadow factor controls penetration of opaque objects. The computation of shadows is a responsibility of light shaders in mental ray; in order to compute transparent shadows this may involve the cooperation of shadow shaders attached to semi-transparent shadow-casting objects.
For example, the mib_light_spot shader in the base shader library implements a spot light. It has a color parameter that must be set to the color of the light, as three scalars for the red, green, and blue components. It also allows a boolean shadow parameter that enables shadows cast from this light if its value is on, and a factor parameter that controls shadow penetration, ranging from 0.0 for black shadows to 1.0 for invisible shadows. The shader also accepts a boolean atten parameter that turns distance attenuation on or off, and two scalar parameters start and stop that specify the range over which the attenuation falls off if atten is on. The spot light mode requires an origin, a direction, and a spread value in the light definition in the scene description file. The spread value in the light definition and the cone parameter of the shader together define the spot characteristics of the light. The cone parameter specifies the angle of the inner solid cone and the spread statement specifies the outer falloff cone. The spot casts a cone of light with a softened edge where the intensity falls off to zero between the cone and spread angles. This and most other shaders specify angles not in degrees but in the cosine of one-half of the opening angle to improve performance: 1.0 is an opening angle of 0 degrees (a laser beam too narrow to see), and 0.707 specifies an opening angle of approximately 90 degrees (because cos(90⁄2) ≈ 0.707), and 0.0 specifies an opening angle of 180 degrees.
Copyright © 1986, 2015 NVIDIA ARC GmbH. All rights reserved.