next up previous contents
Next: Light Sources And Shadows Up: Light Source Shaders Previous: Spot Light Sources   Contents


Area Light Sources

Area light sources are those that are associated with geometry. Similar to the RIB command LightSource there is another RIB command called AreaLightSource which specifies the shader name, a handle, and a parameter list.

light arealight (
    float intensity = 1;
    color lightcolor = 1)
{
    illuminate (P, N, PI/2)
        Cl = intensity * lightcolor / (L.L);
}

Note the similarity to the pointlight shader -- the main difference is that, rather than using a from parameter as the light position, we illuminate from the position P that the renderer chose for us by sampling the area light geometry.



Jan Walter 2004-02-09