Download presentation source

Download Report

Transcript Download presentation source

CS 551/651:
Radiosity Continued
David Luebke
[email protected]
http://www.cs.virginia.edu/~cs551dl
DPL
7/27/2016
Administrivia

Interesting talk
– Vic Sptizer, on the
Visible Human project
– Thursday March 11, 1:30 PM
– Newcomb Hall theatre
Graphics lunch (Fridays at noon)
 Midterm next Thursday (March 11)

DPL
7/27/2016
Midterm
Format: in-class, closed-book,
closed-note, closed-computer quiz
 Topics: All lectures, all reading.
Good candidate topics:

– Ray tracing
Principles & limitations
 Optimizations
 Advanced techniques

DPL
7/27/2016
Midterm

Topics continued
– Antialiasing: theory & practice
Frequency domain, Nyquist limits, etc
 Convolution, filters, etc.
 Sampling strategies
 Antialiasing & texture mapping

DPL
7/27/2016
Midterm

Topics continued
– Radiosity
Principles & limitations
 Progressive radiosity
 Computing form factors

DPL
7/27/2016
Radiosity: Recap
Radiosity methods compute global
illumination by modeling light
transfer among all surfaces
 Radiosity: the rate at which energy
leaves the surface
 Surfaces are assumed to be
Lambertian, or perfectly diffuse: all
reflected or emitted light radiates in
all directions equally

DPL
7/27/2016
Radiosity: Recap

Surfaces are broken into patches
over which intensity is constant
– In practice, we use polygonal patches

Thus, in a closed environment:
Bi = Ei + i
 Bj Fij
Bi = radiosity of patch i
Ei = emitted energy of patch i
i = reflectivity of patch i
Fij = form factor of patch i w.r.t. patch j
DPL
7/27/2016
Radiosity: Recap
1 - 1F11
- 2F21
.
.
.
- pnFn1




DPL
- 1F12
1 - 2F22
.
.
.
- nFn2
… - 1F1n
… - 2F2n
…
.
…
.
…
.
… 1 - nFnn
B1
B2
.
.
.
Bn
E1
E2
.
.
.
En
Note: Ei values zero except at emitters
Note: Fii is zero for convex or planar patches
Note: sum of form factors in any row = 1 (Why?)
Note: n equations, n unknowns!
7/27/2016
Form Factors

The form factor between patch i and
patch j is the fraction of the energy
leaving the entirety of patch i’s
surface that reaches patch j.
– Distance
– Shape
– Orientation
– Occlusion
DPL
7/27/2016
Form Factors

Calculating form factors is hard
– Analytic form factor between two
polygons in general case: open
problem till last few years
Q: So how might we go about it?
 Hint: Clearly form factors are related
to visibility: how much of patch j can
patch i “see”?

DPL
7/27/2016
Form Factors: Hemicube

Hemicube algorithm: Think Z-buffer
– Render the model onto a hemicube as
seen from the center of patch i
– Store item IDs instead of color
– Use Z-buffer to resolve visibility
– See W&W p 278

DPL
Q: Why hemicube, not hemisphere?
7/27/2016
Form Factors: Hemicubes

Advantages of hemicubes
– Solves shape, size, orientation, and
occlusion problems in one framework
– Can use hardware Z-buffers to speed
up form factor determination (How?)
DPL
7/27/2016
Form Factors: Hemicubes

Q: What are some disadvantages of
hemicubes?
– Aliasing! Low resolution buffer can’t
capture actual polygon contributions
very exactly

Causes “banding” near lights (plate 41)
– Actual form factor is over area of patch;
hemicube samples visibility at only
center point on patch (So?)
DPL
7/27/2016
Form Factors: Ray Casting

DPL
Idea: shoot rays from center of patch
in hemispherical pattern
7/27/2016
Form Factors: Ray Casting

Advantages:
– Hemisphere better approximation than
hemicube

More even sampling reduces aliasing
– Don’t need to keep item buffer
– Slightly simpler to calculate coverage
DPL
7/27/2016
Form Factors: Ray Casting

Disadvantages:
– Regular sampling still invites aliasing
– Visibility at patch center still isn’t quite
the same as form factor
– Ray tracing is generally slower than
Z-buffer-like hemicube algorithms
Depends on scene, though
 Q: What kind of scene might ray tracing
actually be faster on?

DPL
7/27/2016
Form Factors

Source-to-vertex form factors
– Calculating form factors at the patch
vertices helps address some problems:
for every patch vertex
for every source patch
sample source evenly with rays
visibility = % rays that hit
– Q: What are the problems with this
approach?
DPL
7/27/2016
Form Factors

Summary of form factor computation
– Analytical:

Expensive or impossible (in general case)
– Hemicube
Fast, especially using graphics hardware
 Not very accurate; aliasing problems

– Ray casting
Conceptually cleaner than hemicube
 Usually slower; aliasing still possible

DPL
7/27/2016
Substructuring
More patches  better results
 Problem: # form factors grows
quadratically with # patches
 Substructuring: adaptively subdivide
patches into elements where high
radiosity gradient is found

DPL
7/27/2016
Substructuring

Elements are second-class patches:
– When a patch is subdivided, form
factors are computed from the
elements to other patches
– But form factors from the other patches
to the elements are not computed

DPL
However, the form factors from other
patches to the subdivided patch are
updated using more accurate areaweighted average of elements
7/27/2016
Substructuring

Elements vs. patches, cont.
– Elements “gather” radiosity from other
patches
– But those other patches only gather
radiosity from the “parent” patch, not
the individual elements
– So an element’s contribution to other
patches is approximated coarsely by
it’s patch’s radiosity
DPL
7/27/2016
Substructuring

Bottom line:
– Substructuring allows subpatch
radiosities to be computed without
changing the size of the form-factor
matrix
– Show examples:

W&W plate 38, F&vD plate III.21
– Note: texts aren’t clear about adaptive
subdivision vs substructuring
DPL
7/27/2016
Progressive Radiosity
Good news: iterative solver of
radiosity matrix will converge
 Bad news: can take a long time
 Progressive radiosity: reorder
computation to allow viewing of
partial results

DPL
7/27/2016
Progressive Radiosity

Radiosity as described uses GaussSeidel iterative solver
– Must do an entire iteration to get an
estimate of patch radiosities
– Must precompute and store all O(n2)
form factors
DPL
7/27/2016
Progressive Radiosity
1 - 1F11
- 2F21
.
.
.
- pnFn1


DPL
- 1F12
1 - 2F22
.
.
.
- nFn2
… - 1F1n
… - 2F2n
…
.
…
.
…
.
… 1 - nFnn
B1
B2
.
.
.
Bn
E1
E2
.
.
.
En
Evaluating row i estimates radiosity of patch i based
on all other patches
We say the patch gathers light from the
environment
7/27/2016
Progressive Radiosity

Progressive radiosity shoots light
from a patch into the environment:
Bj due to Bi = j Bj Fji
Bi due to Bj = i Bj Fij

DPL
j
j
rather than
Given an estimate of Bi, evaluating
this equation estimates patch i’s
contribution to the rest of the scene
7/27/2016
Progressive Radiosity

A problem: evaluating the equation
Bj due to Bi = j Bj Fji j
requires knowing Fji for each patch j
 Determining these values requires a
hemicube computation per patch
 Use reciprocity relationship to get
Bj due to Bi = j Bj Fij (Ai/Aj)
DPL
j
7/27/2016
Progressive Radiosity

Now evaluation requires only a single
hemicube about patch i
– Compute, use, and discard form factors
– Drastically reduces total storage!

Reorder radiosity computation:
– Pick patch w/ highest estimated radiosity
Shoot to all other patches
 Update their estimates

– Pick new “brightest” patch and repeat
DPL
7/27/2016
Progressive Radiosity
We can look at the scene after every
iteration through this loop
 Q: How will it look after 1 loop?
 Q: 2 loops?
 Q: If m = # of light sources, how will it
look after m loops? After 2m loops?

DPL
7/27/2016
Progressive Radiosity

Subtleties:
– Pick patch with most energy to shoot

Energy = radiosity * area = Bj Ai
– A patch may be selected to shoot again
after new light has been shot to it
– So don’t shoot Bj , shoot Bj, the
amount of radiosity patch i has
received since it was last shot
DPL
7/27/2016