Active Rays and Live Rays
"Live Rays" - these are all rays in memory, even if they have been halted, or have errors.
In a multi-threaded raytrace, the source rays are shared between the CPU cores. E.g. over two cores, core # 1 will get the odd numbered rays, and core #2 will get the even numbered rays to trace. Then, during the raytrace, when a ray creates a child ray, the child ray goes to the back of the queue on the same core. E.g. if a child ray is created on core #2, then it will be assigned the next available even number.
At the end of the raytrace, the list is combined which can result in "empty slots" due to cores creating unequal amounts of child rays. The rays are not shuffled around to fill in the gaps. These empty slots remain.
The IsRayLive command takes the ray id number and checks if this slot in the list is empty or actually holds a ray.
Or course, empty slots are also created if the user explicitly deletes rays using the DeleteRay command or via the Ray Manipulation Utilities dialog but the above is the most common cause.
Note that if the user uses the GetFirstRay, GetNextRay commands to loop over the rays (what we call the "Ray Loop") these automatically jump over the empty slots and therefore are always looking at live rays.
'The Ray Loop Dim success as Boolean, i as long, ray as T_RAY success = GetFirstRay(i, ray) while success 'do something with the ray success = GetNextRay(i, ray) Wend
"Active Rays" - in almost all cases, unless the user has explicitly deactivated a ray using SetRayActive False or via the Ray Manipulation Utilities dialog, the ray is "Active." Inactive rays are those that remain in memory, but are not raytraced further, nor included in any analyses.
In most cases, rays that are halted with an error are still Active Rays because up until that point they are valid.