Keywords: main

Next: 2.3 Materials Up: 2. Physics Shaders/A> Previous: 2.1 Lens Shader: physical_lens_dof

# 2.2 Light Shader: 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/ed 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.

        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.

Next: 2.3 Materials Up: 2. Physics Shaders/A> Previous: 2.1 Lens Shader: physical_lens_dof