|Context(s)||displace fog surface|
int sample_light(int lightid, vector pos, vector sam, float time, vector &pos, vector &clr, float &scale, ...)
An integer identifying a light. You can get a list of light IDs for lights affecting the currently shaded surface with getlights.
The surface point from which lights should be sampled. Area light sources will attempt to distribute samples by solid angle from the position - that is, light geometry that is closer to the position will receive more samples.
A vector of random values, such as those generated by nextsample. Currently only the first 2 components of
sam are used. Different values of
sam translate into different random positions on the geometry of the light source.
Time to shade at.
The function modifies the values of the following arguments:
The sampled position on the light source.
The light color set by the light shader.
The light average hemispherical intensity (for area lights).
A component bitmask indicating what types of component bounces the light affects.