To handle scenes with occlusion, the geometry of the scene is inserted into a BSP. The tree is traversed in front to back order with respect to the viewing position. The vertices of each triangle are projected onto the unit sphere, and the triangle is stored as arcs between the vertices. If any of the previously projected triangles intersect the new triangle, the difference is computed and stored because the previous triangles are necessarily in front of the new one because of the order traversal of the BSP. The remainder of this subtraction is stored and the rest is discarded. When all triangles have been processed, they are projected back into world coordinates and the form factors are evaluated.
An obvious optimization was partially implemented. In the naive implementation, for every triangle processed, an overlap test is performed for every previously processed triangle. In order reduce the unnecessary tests, the surface of the sphere was recursively partitioned. The base of the recursion are the six points where rectilinear axes intersect the sphere. The recursion step is to average three closest points an split the triangle they form into three new triangles using the original points and the average. Using this partition, it is possible to test only those triangles which are likely to overlap the new triangle.
A generated scene with 200 triangles was used analyze the
effectiveness of the algorithm. The following is a plot of the form
factor as computed by the new algorithm versus the form factor
computed by a hemi-cube algorithm with a resolution of 100x100
pixels:
And the following is a plot of the form factor as computed by the new
algorithm versus the absolute normalized error of the hemi-cube
algorithm:
Note that the error generally decreases with the magnitude of the form factor. This trend is due to the fact that a larger form factor indicates that the triangle covers a larger number of pixels in the hemi-cube frame buffer, and its area is therefore estimated more accurately. Clearly the extra cost of the accurate algorithm pays off when the form factor is small. This could be important in a radiosity solution, for example when a scene contains small, bright emitters.