Keywords: main

Next: 1.12 Light Mapping Up: 1. Base Shaders/A> Previous: 1.10 Light

# 1.11 Shadow

Shadow shaders can only be attached to `shadow` statements in material statements, directly or indirectly in a Phenomenon. They are called when a shadow ray hits an occluding object; the shadow shader of the occluding object controls how much light is transmitted. Shadow shaders are special in that their result color is also an input color, which means that the output cannot be attached to another shader parameters because such attachments are one-way, output-to-parameter only. In a Phenomenon, shadow shaders can only be attached to a material inside the Phenomenon, or to the Phenomenon root if the Phenomenon is attached to a material's shadow shader.

Transparency

The transparency shadow shader can be used to assign a (possibly transparent) color to an object, and to make it transparent for shadow rays. Either a color alpha < 1 or a nonzero transparency cause shadow rays to be transmitted through the object.

        color "mib_shadow_transparency" (
            color           "color",
            color           "transp",
            integer         "mode",
            array light     "light")

color is the RGBA color of the object, which becomes a multiplier for the light color being transmitted.

transp is an RGB transparency. Value 0 is opaque; value 1 is fully transparent. Internally, the transparency RGB components are multiplied by the alpha value of the color before being used.

mode controls the meaning of the light list: all (0), inclusive (1), exclusive (2), or no light dependency (3).

light is a list of light instances to loop over to detect whether the current light (for which shadows are being evaluated) does cause a shadow to be cast from this object. This lets a material control which lights it casts shadows for. If the mode is 0, consider every light in the light list parameter. If the mode is 1, consider all lights in the global light list that correspond to the lights in the light list parameter (inclusive mode). If the mode is 2, consider all lights in the global light list that do not correspond to the lights in the light list parameter (exclusive mode). If the mode is 3, the light list is ignored and a shadow is always cast (which is more efficient than mode 2 with an empty light list).

Next: 1.12 Light Mapping Up: 1. Base Shaders/A> Previous: 1.10 Light