Computing Form-Factors How to compute form factors Fij ® for radiative exchange between 2 surfaces with areas Ai, Aj: - First consider 2 infinitesimal surfaces dAi, dAj. Solid angle subtended by dAj (as seen from dAi) is dw = Cosfj dAj r2 From eq. 1 and 3a 1 ® i = dp / (Cosf dw) 3a ® P = ip Radiant energy leaving Ai and incident on dAj is dPi dAi = ii Cosfi dw dAi = Pi Cosfi Cosfj dAi dAj pr2 Note: total energy leaving dAi into hemisphere is Pi dAi. Now form factor is fraction of energy incident on dAj so FdAi - dAj = Pi Cosfi Cosfj dAi dAj / pr2 = Cosfi Cosfj dAj Pi dAi pr2 So fraction leaving dAi and incident on Aj is FdAi - Aj ò Aj Cosfi Cosfj dAj pr2 then form factor between surfaces Ai, Aj is area average of above FAi - Aj = Fij = (1/Ai ò Ai ò Aj Cosfi Cosfj dAi dAj pr 2 A more efficient method of computing Fij is to transform area integrals into contour integrals using Stokes theorem and get Fij = [1/(2pAi)] ò Cj ò Ci [ln(r) dXi dXj + ln(r) dYi dYj = ln(r) dZi dZj] From derivation of F's some possible shortcuts: 1. Ai Fij = Aj Fij so if know Ai, Aj, Fij can determine Fji 2. From conservation of energy ® all energy leaving a surface must be accounted for so (N surfaces) Sj=1N Fij = 1 3. For a plane or convex surface (doesn't see itself) ® Fii = 0 So general algorithm: - Read in scene description (polygon mesh) - Subdivide polygons into elements (sub-polygon) - the smaller the element the more accurate the results, since compute 1 radiosity value/patch. - Compute form factors between all elements. - Now once Fij's are computed, put into matrix equations for radiosities(bj) and solve for bj's. - Smooth shading across elements (similar to Gouraud) - Display image. To be really precise would solve matrix for each l (since r [assume continuous] is f(l), but usually just for RGB values). Above derivation ignores possible occlusion of surfaces, so good only for very simple scenes - no shadows or penumbras. Cohen and Greenberg extended for more complex scenes. A geometric analog of form factor integral was developed by Nusselt: Consists of projecting element area (Aj) onto hemisphere covering Ai, then projecting down to a circle, and determine fraction of unit circle covered. Now could decompose hemisphere into small d solid angles representing d fij's. Then F for a patch would be S dF's covered when patch projected onto hemisphere. Problem: difficult to create equal sized elements on sphere and set of linear coordinates to describe surface location on sphere. So instead of using a sphere, center a cube on patch ® hemi-cube. We can do this since any 2 patches whose projections occupy some area and location on hemisphere give same form factor - also true for any other surrounding surface. Faces of hemi-cube are divided into source "pixels" and patches are projected onto "pixels" (might have 50 × 50, 100 × 100, time ¬ accuracy trade-off). Handles visible surface and shadow problem: If >= 2 patches project onto same pixel do depth determination ® so have type of depth buffer ® "item buffer" ® which patch is visible at each "pixel". Now can compute a delta form factor for each pixel in hemi-cube. So to find Fij (hemi-cube on i): - for each "pixel" occupied by patch j sum delta form factors. Fij = Sq=1R DFq D Fq = delta form factor associated with pixel q on hemi-cube. R = # of hemi-cube pixels covered by projection of patch onto hemi-cube. To solve matrix equation: Now make guess at initial set of radiosities (emission light source only, so only non-zero). Solve for b's, in terms of other b's, iterate process until self consistent - usually 6-8 iteration. Now have computed radiosity (intensity) for each patch. To render, want smooth shading so do Gouraud type bi-linear interpolation across patch. So to render, find ray from eye through pixel and intersection with visible patch. This X, Y, Z values ® U, V within patch and do interpolation. Note: Advantage for animation ® if lights not changed (only view) the F's only computed once. Example: F's computation - 90 % of total, but 0 for other views.