Lens

Lens shaders may not only be used to change the direction of eye rays. They may also be used to manipulate colors and even the apparent shape of the rendered images.

Stencil

The stencil lens shader may be used to block out portions of an image by overlaying a stencil texture. Only if the returned value of the provided scalar texture is between the prescribed floor and ceiling value an eye ray will be cast. If the texture value is below the provided floor value, then the floor color will be used, if the texture value is above the ceiling value, then the ceiling color will be used. If the texture value is between the floor and the ceiling value, then the returned color will be blended with the floor color with the weight provided by the relative texture value with respect to the floor and ceiling values.

mib_lens_stencil
    color "mib_lens_stencil" (
        scalar          "floor",
        scalar          "ceiling",
        color           "floor_color",
        color           "ceiling_color",
        scalar texture  "stencil")
floor
if the value of the scalar stencil texture is below this value, then the current sample color is replaced with the floor color. The default floor value is 0.
ceiling
if the value of the scalar stencil texture is above this value, then the current sample color is replaced with the ceiling color. The default ceiling value is 1.
floor_color
is the color used for samples where the scalar stencil texture value is less than the floor value. The default value is black.
ceiling_color
is the color used for samples where the scalar stencil texture value is greater than the ceiling value. The default value is black.
stencil
is a scalar-valued 2D texture acting as a stencil overlaid over the camera lens.

Clamp

This lens shader maps color components lying between a floor and a ceiling value to the unit interval. Values below and above those limits are clamped to 0 and 1, respectively. If the mode of the shader is set to luminance, then the sample colors with a luminance below the floor value are replaced by the floor color and sample colors with a luminance above the ceiling value are replaced by the ceiling color. Color values with luminance between those bounds are linearly scaled to luminances between 0 and 1.

mib_lens_clamp
    color "mib_lens_clamp" (
        scalar          "floor",
        scalar          "ceiling",
        boolean         "luminance",
        color           "floor_color",
        color           "ceiling_color")
floor
is the lower bound. Color coponents below this value are set to 0 if luminance is false. In luminance mode, color samples with luminance below this value are assigned the floor color. The default value is 0.
ceiling
is the upper bound. Color components greater than this value are set to 1 if luminance is false. In luminance mode, color samples with values greater than this value are assigned the ceiling color. The default value is 1.
luminance
if true, the shader operates in luminance mode. If false, the shader operates in color component mode.
floor_color
in luminance mode all color samples with a luminance below the floor value will be assigned this color. The default value is black. This parameter is ignored in color component mode.
ceiling_color
in luminance mode all color samples with a luminance greater than the ceiling value will be assigned this color. The default value is black. This paramter is ignored in color component mode.

Copyright (©) 1986-2009 by mental images GmbH