Read CW[10] Chapter 7 to page 187.
The N-body problem is to solve for the gravitational forces acting on each particle due to the n-1 other particles in the environment. There are a total of n(n-1) of these forces. The goal is to compute the effect of these forces in less than quadratic time. The observations that were made are
There have been several papers on this idea, with the first being
Appel[1]. He claimed to have an
algorithm for solving these interactions through building a hierarchy
of clusters of objects and approximating the forces between particles
in two clusters with a single force. His algorithm was latter shown
to be linear in the solution stage, and
for the creation
of the hierarchy. Work by Greengard[16] created
an algorithm that was (proven)
.
Other algorithms were
created by Barnes and Hut[27].
Both approaches are similar in that they group particles together and
treat the aggregate as a single object. For distant interactions, the
two clusters can be very large, resulting in a large reduction in cost
for those transfers. Since most interactions are distant
(gravitational strength falls off as
), most of the
work disappears.
Radiosity is very similar in spirit to the N-body problem. There are
n objects and we are concerned with the effects on each object of
the n-1 other objects. The strength of the effects falls off as
.
There are a few significant differences as well
First a simple 1D case of a line segement subdivided using a binary tree. Assume the line segment can interact with itself. Also, lets assume that there is too much error for any segment to interact directly with itself or its neighbors. Given this, how many interactions are there? A constant number per node. This can be seen by looking at the diagram in Hanrahan's Hierarchical Radiosity paper[19]. We want to do the same thing in 3D, and have the same result hold. Lets look at the matrix for this situation. Values near the diagonal are large and represented by small blocks, values far from the diagonal are small, and are represented by large blocks.
For each pair of initial surfaces, we create a set of interactions that accounts for the transfer of energy from the source to the receiver. When done, for each pair of points on the receiver and the source, there exists a single link connecting them. This link may not exist on a leaf of either the source or the receiver, but it does exist somewhere in the hierarchy.
The procedure for creating the links looks like this
CreateLinks(Rec, Src)
if(FormFactorError(Rec,Src) < eps)
Link(Rec,Src)
else switch SubdivideWhich(Rec,Src)
case REC:
foreach Child of Rec
CreateLinks(Child,Src)
case SRC:
foreach Child of Src
CreateLinks(Rec,Child)
case NEITHER:
Link(Rec,Src)
FormFactorError determines the error in an interaction at this level. That can includes form factor error, visibility error, non-constant source error, and the total amount of energy/radiance travelling over the link. Note that while this is being determined, most form factor data is also being computed. This should be available for use by the Link subroutine. The various bits of information about the error should be available for use by the SubdivideWhich routine.
SubdivideWhich determines which object should be subdivided. An easy criteria is to subdivide the largest. A better criteria is to subdivide the one contributing the most to the error. Remember that you may want area thresholds to keep subdivision from going too far. For this and other reasons, you may not be able to subdivide one (or both) of the objects.