intersect_lights
VEX function
Finds the nearest intersection of a ray with any of a list of (area) lights.
Contexts: displace, fog, light, shadow, surface
See also: getlights, getlightname
-
intersect_lights(int lightids[], vector pos, vector dir, float time, int &lightid, float &dist)
Only area lights will produce intersections.
|
|
An array of light IDs, as returned by getlights. |
|
|
The origin of the ray (such as the global variable |
|
|
Direction vector from the origin. The length of this vector does not affect the distance the ray will travel. |
|
|
Time to send the ray at. |
The function modifies the values of the following arguments:
|
|
The integer ID of the nearest intersected light. You can convert this ID into a light name using getlightname. |
|
|
The distance to the nearest intersected light. |