Category: mental ray > Texture
mental ray supports light mapping as a two-stage process that runs on certain objects (whose materials contain a lightmap shader) to compute illumination or other information, and write the result into a texture or elsewhere. The first stage calls the lightmap shader in vertex mode once for every vertex of the object, and collects the returned information. The second stage calls the lightmap shader in output mode to use the collected information to paint a texture or other output data by looping over all triangles of the object.
The lightmap shaders in the base shader library collect direct and indirect illumination, and create a writable texture map from it. Although mental ray knows about only one lightmap shader, the base lightmap shader is split into the main shader that handles the output stage, and a separate shader for the vertex stage that is called by the main shader. This makes it easier to substitute only one stage with another user-written shader.
The mib_lightmap_sample shader is a simple color shader that samples the surface light influx density. It gathers direct illumination and optionally indirect illumination. It should be connected to the input port (parameter) of the mib_lightmap_write shader.
Creates a light list to specifiy which lights should produce the effect. For more information, see Using Light Lists [Direct Illumination].