
120 II Rendering
for( int i =0; i <nBodies ; i +=64)
{
int il = lIdx + i;
if ( il < nBodies )
{
if (overlaps ( frustum , gLightGeometry[il]))
{
appendLightToList(il);
}
}
}
In overlaps(), a light-geometry overlap is checked against a frustum using the
separating axis theorem [Ericson 04]. If a light is overlapping the frustum, the
light index is stored to the list of the overlapping lights in
appendLightToList().
There are several data structures we can use to store the light list. The obvious
way would be to build a linked list using a few atomic operations [Yang et al. 10].
However, this approach is relatively expensive: we need to use a few global
atomic op ...