next up previous contents
Next: Point Light Sources Up: Light Source Shaders Previous: Ambient Light Sources   Contents


Distant Light Sources

Unlike an ambient light source, a distant source casts its light in only one direction:

light distantlight ( 
    float intensity = 1;
    color lightcolor = 1;
    point from = point "shader" (0,0,0);
    point to = point "shader" (0,0,1))
{
    solar (to-from, 0)
        Cl = intensity * lightcolor;
}

The vector defined by the difference $(to-from)$ is used in a solar statement to restrict the emission to that direction.



Jan Walter 2004-02-09