mib_lightmap_sample

 
 
 

Category: mental ray > Texture

Shader Family: Texture

Output: Color

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.

Name

The name of the shader node displayed in the render tree. Enter any name you like, or leave the default.

indirect

Tells the shader to sample indirect illumination too.

flip

An integer value that specifies the side of the geometry to be illuminated.

  • A value of 0 (zero) selects the direction of the normal — the front side.

  • A value of 1 selects the opposite direction — the back side.

  • A value of 2 selects that the illumination be sampled from both directions and combined.

Lights

Creates a light list to specifiy which lights should produce the effect. For more information, see Using Light Lists [Direct Illumination].