Light

Physical Light

The light shader physical_light models physically correct light sources. As for ideal point lights, the light intensity falls off with the inverse square of the distance. If physical correctness is not important, this falloff can be modified by changing exponent; in general the falloff is 1/e^d where e is the falloff exponent and d is the distance between the light source and the illuminated point. For directional lights there is no falloff since the light rays are parallel.

physical_light
    color "physical_light" (
        color           "color",
        scalar          "cone",
        scalar          "threshold",
        scalar          "cos_exp")
color
specifies the light energy. Since this shader is physically correct, its energy is distance-dependent and not normally in the range 0...1. This is normally a copy of the light source energy, but keeping it separate makes it possible to adjust direct and indirect illumination separately.

cone
is the cosine of the opening angle of the inner solid cone, if the shader is attached to a spot light source.

threshold
is for optimization: if the illumination is less than threshold, the illumination can be discarded and no shadow rays need to be cast. The default is 0.

cos_exp
is for flat area lights only (rectangle and disc): the default cosine illumination distribution is made more narrow by taking cosine to the cos_exp power. The default is 1.

The shader reads the direction, spread, and exponent parameters directly from the light source.


Copyright (©) 1986-2009 by mental images GmbH