DPL11/27/2015 CS 551/651: Radiosity David Luebke [email protected].
-
Upload
warren-mcdaniel -
Category
Documents
-
view
214 -
download
0
Transcript of DPL11/27/2015 CS 551/651: Radiosity David Luebke [email protected].
DPL 04/18/23
CS 551/651: CS 551/651: RadiosityRadiosity
David LuebkeDavid Luebke
[email protected]@cs.virginia.edu
http://www.cs.virginia.edu/~cs551dlhttp://www.cs.virginia.edu/~cs551dl
DPL 04/18/23
AdministriviaAdministrivia
Hand in Assignment 1 (again)Hand in Assignment 1 (again) Questions about Assignment 2?Questions about Assignment 2? Read Chapter 11Read Chapter 11
DPL 04/18/23
Radiosity IntroductionRadiosity Introduction
First lighting model: PhongFirst lighting model: Phong– Still used in interactive graphicsStill used in interactive graphics– Major shortcoming: local illumination!Major shortcoming: local illumination!
Two post-Phong approaches:Two post-Phong approaches:– Ray tracingRay tracing– RadiosityRadiosity
DPL 04/18/23
Radiosity IntroductionRadiosity Introduction
Ray tracing: ad hoc approach to Ray tracing: ad hoc approach to simulating opticssimulating optics– Deals well with specular reflectionDeals well with specular reflection– Trouble with diffuse illuminationTrouble with diffuse illumination
Radiosity: theoretically rigorous Radiosity: theoretically rigorous simulation of light transfersimulation of light transfer– Very realistic imagesVery realistic images– But makes simplifying assumption: But makes simplifying assumption: onlyonly
diffuse interaction!diffuse interaction!
DPL 04/18/23
Radiosity IntroductionRadiosity Introduction
Ray-tracing:Ray-tracing:– Computes a Computes a view-dependentview-dependent solution solution– End result: a pictureEnd result: a picture
Radiosity:Radiosity:– Models only diffuse interaction, so can Models only diffuse interaction, so can
compute a compute a view-independentview-independent solution solution– End result: a 3-D modelEnd result: a 3-D model
DPL 04/18/23
RadiosityRadiosity
Basic idea: represent surfaces in Basic idea: represent surfaces in environment as many discrete environment as many discrete patchespatches
A patch, or A patch, or elementelement, is a polygon , is a polygon over which light intensity is constantover which light intensity is constant
DPL 04/18/23
RadiosityRadiosity
Model light transfer between patches Model light transfer between patches as a system of linear equationsas a system of linear equations
Solving this system gives the intensity Solving this system gives the intensity at each patchat each patch
Solve for R, G, B intensities and get Solve for R, G, B intensities and get color at each patchcolor at each patch
Render patches as colored polygons Render patches as colored polygons in OpenGL. Voila! in OpenGL. Voila!
DPL 04/18/23
FundamentalsFundamentals
Theoretical foundation: heat transfer Theoretical foundation: heat transfer Need system of equations that Need system of equations that
describes surface interreflections describes surface interreflections Simplifying assumptions:Simplifying assumptions:
– Environment is closedEnvironment is closed– All surfaces are All surfaces are LambertianLambertian reflectors reflectors
DPL 04/18/23
DefinitionsDefinitions
LambertianLambertian surfaces are “perfectly surfaces are “perfectly diffuse”; they reflect incident light in diffuse”; they reflect incident light in all directions equallyall directions equally– Q: Q: Do Lambertian surfaces really Do Lambertian surfaces really
exist?exist? The The radiosityradiosity of a surface is the rate of a surface is the rate
at which energy leaves the surface at which energy leaves the surface
DPL 04/18/23
RadiosityRadiosity
Radiosity = rate at which the surface Radiosity = rate at which the surface emitsemits energy + rate at which the energy + rate at which the surface surface reflectsreflects energy– Notice: previous methods distinguish Notice: previous methods distinguish
light sources from surfaceslight sources from surfaces– In radiosity all surfaces can emit lightIn radiosity all surfaces can emit light– Thus: all emitters inherently have areaThus: all emitters inherently have area
DPL 04/18/23
RadiosityRadiosity
Break environment up into a finite Break environment up into a finite number number nn of discrete patches of discrete patches– Patches are opaque Lambertian Patches are opaque Lambertian
surfaces of finite sizesurfaces of finite size– Patches emit and reflect light uniformly Patches emit and reflect light uniformly
over their entire surfaceover their entire surface Q: Q: What’s wrong with this model?What’s wrong with this model? Q: Q: What can we do about it?What can we do about it?
DPL 04/18/23
RadiosityRadiosity
Then for each surface Then for each surface ii::
BBii = E = Eii + + ii BBjj F Fjiji ((AAjj / A / Aii))
wherewhere
BBii,, B Bjj= = radiosity of patch radiosity of patch i, ji, j
AAii,, A Ajj= = area of patch area of patch i, ji, j
EEii = = energy/area/time emitted by energy/area/time emitted by ii
ii = = reflectivity of patch reflectivity of patch i i
FFjiji = = Form factorForm factor from from j j to to ii
DPL 04/18/23
Form FactorsForm Factors
Form factor: fraction of energy Form factor: fraction of energy leaving the entirety of patch leaving the entirety of patch ii that that arrives at patch arrives at patch jj, accounting for:, accounting for:– The shape of both patchesThe shape of both patches– The relative orientation of both patchesThe relative orientation of both patches– Occlusion by other patchesOcclusion by other patches
DPL 04/18/23
Form FactorsForm Factors
Some examples… Some examples…
Form factor: nearly 100%
DPL 04/18/23
Form FactorsForm Factors
Some examples… Some examples…
Form factor: roughly 50%
DPL 04/18/23
Form FactorsForm Factors
Some examples… Some examples…
Form factor: roughly 10%
DPL 04/18/23
Form FactorsForm Factors
Some examples… Some examples…
Form factor: roughly 5%
DPL 04/18/23
Form FactorsForm Factors
Some examples… Some examples…
Form factor: roughly 30%
DPL 04/18/23
Form FactorsForm Factors
Some examples… Some examples…
Form factor: roughly 2%
DPL 04/18/23
Form FactorsForm Factors
In diffuse environments, form factors In diffuse environments, form factors obey a simple reciprocity relationship:obey a simple reciprocity relationship:
AAii F Fijij = A = Ai i FFjiji
Which simplifies our equation:Which simplifies our equation:
BBii = E = Eii + + ii BBjj F Fijij
Rearranging to:Rearranging to:
BBii - - ii BBjj F Fij ij = E= Eii
DPL 04/18/23
Form FactorsForm Factors
So…light exchange between all patches So…light exchange between all patches becomes a matrix:becomes a matrix:
1 - 1F11 - 1F12 … - 1F1n B1 E1
- 2F21 1 - 2F22 … - 2F2n B2 E2
. . … . . .
. . … . . .
. . … . . .
- pnFn1 - nFn2 …1 - nFnn Bn En
Q: Q: What do the various terms mean?What do the various terms mean?
DPL 04/18/23
Form FactorsForm Factors
1 - 1F11 - 1F12 … - 1F1n B1 E1
- 2F21 1 - 2F22 … - 2F2n B2 E2
. . … . . .
. . … . . .
. . … . . .
- pnFn1 - nFn2 … 1 - nFnn Bn En
Note: Note: EEii values zero except at emitters values zero except at emitters Note: Note: FFiiii is zero for convex or planar patches is zero for convex or planar patches Note: sum of form factors in any row = 1 (Note: sum of form factors in any row = 1 (Why?Why?)) Note: Note: nn equations, equations, n n unknowns!unknowns!
DPL 04/18/23
RadiosityRadiosity
Now “just” need to solve the matrix!Now “just” need to solve the matrix!– W&W: matrix is “diagonally dominant”W&W: matrix is “diagonally dominant”– Thus Guass-Siedel must convergeThus Guass-Siedel must converge
End result: radiosities for all patchesEnd result: radiosities for all patches Solve RGB radiosities separately, Solve RGB radiosities separately,
color each patch, and render!color each patch, and render! Caveat: actually, color vertices, not Caveat: actually, color vertices, not
patches (see F&vD p 795)patches (see F&vD p 795)
DPL 04/18/23
RadiosityRadiosity
Q: Q: How many form factors must be How many form factors must be computed?computed?
A: O(A: O(nn22)) Q: Q: What primarily limits the accuracy What primarily limits the accuracy
of the solution?of the solution? A: The number of patchesA: The number of patches
DPL 04/18/23
RadiosityRadiosity
Where we go from here:Where we go from here:– Evaluating form factorsEvaluating form factors– Progressive radiosityProgressive radiosity: viewing an : viewing an
approximate solution earlyapproximate solution early– Hierarchical radiosityHierarchical radiosity: increasing patch : increasing patch
resolution on an as-needed basisresolution on an as-needed basis