Archived Questions & Answers (June 03, 1999):

 Question: Author: Date: On Form Factor Calculation Aggravated Nosebleed 03 June 1999 More Radiosity Questions Aggravated Nosebleed 31 May 1999 Age Old Programming Debate Christopher Dudley 29 May 1999

On Form Factor Calculation - 03 June 1999

Thank you for all the help you've given so far, it's really cleared things up.

I've got a patch creation, subdivision and coversion back to lightmap system set up. In an effort to avoid the problem of splitting long narrow patches into even more narrow subpatches I split each polygon into 3 by cutting at the middle of each edge of the original patch. My problem now is calculating the patch-to-patch form factor. I've tried to wrap my brain around the equations presented in Computer Graphics: Principles & Practice (2nd ed, p.796 eqn 16.65) but I'm having real trouble. The eqn' looks like

 ``` F(src-dest) = (1/src.area) * (integral from 0 to Src.area)[ (integral from 0 to Dest.area) [ ( cos( thetaS ) * cos( thetaD ) ) / ( PI * d.length ^ 2 ) * H(ij) * dSrc.area ] * dDest.area ] ```
where

d = ( dest.center - src.center )
cos( thetaS ) = fabs( dotProduct( d, src.normal ) ) / d.length
cos( thetaD ) = fabs( dotProduct( d, dest.normal ) ) / d.length
H(ij) = Line of sight between dest.center and src.center?

meaning that I should have been able to do

 ``` if( line of sight between dest.center and src.center ) { factor = ( fabs( dotProduct( d, src.normal ) ) / d.length ) * fabs( dotProduct( d, dest.normal ) ) / d.length ) factor /= PI * d.length * d.length factor *= dest.area / src.area } ```
and ta da! I should have a value in the range (0,1) that is a percentage of the light that travels from src to dest, right? So why am I getting values WAY out of bounds? Thank you!

Question by: Aggravated Nosebleed

I noticed in your calculations, you perform your dot products followed by a divide by the length of the vector. I assume this is because they are not unit vectors...

And no, you should not have a value from [0...1], you should have a value between 0 and infinity. This number represents the amount of light that one patch shoots to another patch. There are two things that can cause the numbers to go beyond 1.0.

1. If the distance of your patches is less than 1.0. You'll want to try to prevent this, since this causes aliasing and other artifacts in the results.

2. If the receiving patch is larger than the transmission patch. In this case, the differential area calculation will divide the larger by the smaller, and your values will go beyond 1.0. This is perfectly acceptable (and necessary.)

Your question has prompted me to write another document titled "Radiosity In English II". In this document, I discuss this calculation in detail, and how it relates to the physical world.

At the end of this document, I also discuss the numbers that will be flowing through this calculation. You might find it helpful.

More Radiosity Questions - 31 May 1999