radiosity 1. 2 introduction ray tracing best with many highly specular surfaces not real scenes...
TRANSCRIPT
Radiosity
1
2
Introduction
•Ray tracing best with many highly specular surfaces
Not real scenes
•Rendering equation describes general shading problem
•Radiosity solves rendering equation for perfectly diffuse surfaces
3
Terminology
•Energy ~ light (incident, transmitted) Must be conserved
•Energy flux = luminous flux = power = energy/unit time
Measured in lumens
Depends on wavelength so can integrate over spectrum using luminous efficiency curve of sensor
•Energy density (Φ) = energy flux/unit area
4
Terminology
Intensity ~ brightness/lightness Brightness/lightness perceptual
= flux/area-solid angle = power/unit projected area per solid angle
Measured in candela
Φ = ∫ ∫ I dA dω
5
Rendering Eqn (Kajiya)
•Consider point on surface
N
Iout(Φout)Iin(Φin)
6
Rendering Equation
•Outgoing light from two sources Emission
Reflection of incoming light
•Must integrate over all incoming light Integrate over hemisphere
•Must account for foreshortening of incoming light
7
Rendering Equation
Iout(Φout) = E(Φout) + ∫ 2πRbd(Φout, Φin )Iin(Φin) cos θ dω
bidirectional reflection coefficient
angle between normal and Φinemission
Note that angle is really two angles in 3D and wavelength is fixed
8
Rendering Equation
• Rendering equation = energy balance Energy in = energy out
• Integrate over hemisphere
• Fredholm integral equation Cannot solve analytically in general
• Various approximations of Rbd give standard rendering models
• Should also add occlusion term in front of right side to account for other objects blocking light from reaching surface
9
Another version
Consider light at point p arriving from p’
i(p, p’) = υ(p, p’)(ε(p,p’) + ∫ ρ(p, p’, p’’)i(p’, p’’)dp’’
occlusion = 0 or 1/d2emission from p’ to p
light reflected at p’ from all points p’’ towards p
10
Radiosity
•Consider objects to be broken up into flat patches
may correspond to polygons in model
•Assume patches = perfectly diffuse reflectors
•Radiosity = flux = energy/unit area/ unit time leaving patch
11
Notation
n patches numbered 1 to n
bi = radiosity of patch i
ai = area of patch i
bi ai = total intensity leaving patch i
ei ai = emitted intensity from patch i
ρi = reflectivity of patch i
fij = form factor = fraction of energy leaving patch j that reaches patch i
form factor
In physics, (usually written e) of material
sometimes called emissivity
= proportion of energy transmitted by object
that can be transferred to another objecten.wikipedia.org/wiki/Form_factor_(radiative_transfer)
12
13
Radiosity Equation
energy balance
biai = eiai + ρi ∑ fjibjaj
reciprocity
fijai = fjiaj
radiosity equation
bi = ei + ρi ∑ fijbj
emitted reflected
14
Matrix Form
b = [bi]
e = [ei]
R = [rij] rij = ρi if i ≠ j rii = 0
F = [fij]
15
Matrix Form
b = e - RFb
formal solution
b = [I-RF]-1e
Not useful since n usually very largeAlternative: use observation that F is sparse
Will consider determination of form factors later
16
Solving the Radiosity Equation
For sparse matrices, iterative methods usuallyrequire only O(n) operations per iteration
Jacobi’s method
bk+1 = e - RFbk
Gauss-Seidel: use immediate updates
17
Series Approximation
1/(1-x) = 1 + x + x2+ ……
b = [I-RF]-1e = e + RFe + (RF)2e +…
[I-RF]-1 = I + RF +(RF)2+…
18
Rendered Image
19
Patches
20
Computing Form Factors
•Consider two flat patches
21
Using Differential Patches
foreshortening
22
Form Factor Integral
fij = (1/ai) ∫ai ∫ai (oij cos θi cos θj / πr2 )dai daj
occlusion
foreshortening of patch i
foreshortening of patch j
23
Solving the Intergral
•Very few cases where integral has (simple) closed form solution
Occlusion further complicates solution
•Alternative: use numerical methods•Two step process similar to texture mapping
Hemisphere
Hemicube
24
Form Factor Examples 1
25
Form Factor Examples 2
26
Form Factor Examples 3
27
Hemisphere
•Use illuminating hemisphere•Center hemisphere on patch with normal pointing up
•Must shift hemisphere for each point on patch
28
Hemisphere
29
Hemicube
•Easier to use hemicube instead of hemisphere
•Rule each side into “pixels”•Easier to project on pixels give delta form factors can be added up to give desired form factor
•To get delta form factor need only cast ray through each pixel
30
Hemicube
31
Instant Radiosity
•Want to use graphics system if possible•Suppose make one patch emissive•Light from this patch distributed among other patches
•Shade of other patches ~ form factors•Must use multiple OpenGL point sources to approximate uniformly emissive patch