<<

Last Time? Local vs. Global Illumination • Ray Casting & & Radiosity Ray-Object Intersection • Recursive • Distributed Ray Tracing

An early application of radiative in stables.

Today BRDF • Local Illumination • Ratio of coming from one direction – BRDF that gets reflected in another direction – Ideal Diffuse – Ideal Specular Reflectance • Bidirectional Reflectance – The Phong Model Distribution Function • Why is Global Illumination Important? –4D • Radiosity Equation/Matrix –R(θi ,φi ; θo, φo) • Calculating the Form Factors

Incoming Ideal Diffuse Reflectance

• The amount of light received by a • Assume surface reflects equally in surface depends on incoming angle all directions (a.k.a. Lambertian) – Bigger at normal incidence • An ideal diffuse surface is, at the microscopic level, (Winter/Summer difference) n l a very rough surface • By how much? dB • Examples: chalk, Surface – dB = dA cos θ θ clay, some paints – Same as: l . n (dot product with normal) dA Surface

1 Ideal Specular Reflectance Non-Ideal Reflectors

• Assume surface reflects n • Real materials tend to be neither only in mirror direction θ θ ideal diffuse nor ideal reflective – View dependent r l • Highlight is blurry, looks glossy • Microscopic surface elements are oriented in Surface the same direction as the surface • Examples: mirrors, highly polished metals

Non-Ideal Reflectors The Phong Model

• Most light reflects in the ideal reflected direction • How much light is reflected “specularly”? • Microscopic surface variations will reflect light – Depends on the angle between the ideal reflection direction and the viewer direction α. just slightly offset n • How much light is reflected? Camera r q Li Lo = ks (cosα) 2 θ θ r α l ks: specular reflection coefficient q : specular reflection exponent v Surface

Effect of the q exponent

The Phong Model Ambient Illumination

• Sum of three components: • In a typical room, everything receives at least a diffuse reflection + specular reflection + “ambient”. little bit of light • Ambient illumination represents the reflection of all indirect illumination

L(ωr ) = ka

Surface • This is a total hack!

variations in Phong specular exponent

2 Anisotropic BRDFs Questions?

• Surfaces with strongly oriented microgeometry • Examples: – brushed metals, hair, fur, cloth, velvet

Source: Westin et.al 92

Lightscape http://www.lightscape.com

Today Why Global Illumination?

• Local Illumination • Simulate all light inter-reflections (indirect lighting) • Why is Global Illumination Important? – in a room, a lot of the light is indirect: it is reflected by walls. • How have we dealt with this so far? – The Cornell Box – Ambient term to fake some uniform indirect light – Radiosity vs. Ray Tracing ray tracing indirect illumination “right” answer • Radiosity Equation/Matrix • Calculating the Form Factors

+=

(no ambient term) it is smooth, but not constant! Henrik Wann Jensen

Why Radiosity? Radiosity vs. Ray Tracing

• Sculpture by John Ferren • Diffuse panels photograph:

Original sculpture by Ray traced image. A standard Image rendered with radiosity. diagram John Ferren lit by ray tracer cannot simulate the note color bleeding effects. daylight from behind. interreflection of light between from above: diffuse surfaces.

eye

3 Reading for Today: The Cornell Box

• Careful calibration and measurement allows for comparison between physical scene & simulation

photograph

Goral, Torrance, Greenberg & Battaile photograph simulation Modeling the Interaction of Light Between Diffuse Surfaces Light Measurement Laboratory simulation SIGGRAPH '84 Cornell University, Program for

Two approaches for global illumination Visualizing Inter-reflections…

• Radiosity – View-independent – Diffuse materials only • Monte-Carlo Ray-tracing – Send tons of indirect rays

direct illumination 1 bounce 2 bounces (0 bounces)

images by Micheal Callahan http://www.cs.utah.edu/~shirley/classes/cs684_98/students/callahan/bounce/

Radiosity vs. Ray Tracing Today

• Ray tracing is an image-space algorithm • Local Illumination – If the camera is moved, we have to start over • Why is Global Illumination Important? • Radiosity is computed in object-space • Radiosity Equation/Matrix – View-independent • Calculating the Form Factors (just don't move the light) – Can pre-compute complex lighting to allow interactive walkthroughs

4 Radiosity Overview Radiosity Equation

• Surfaces are assumed to be perfectly Lambertian (diffuse) L(x',ω') = E(x',ω') + ∫ρx'(ω,ω')L(x,ω)G(x,x')V(x,x') dA – reflect incident light in all Radiosity assumption: directions with equal intensity perfectly diffuse surfaces (not directional) • The scene is divided into a set of small areas, or patches. Bx' = Ex' + ρx' ∫ Bx G(x,x')V(x,x')

• The radiosity, Bi, of patch i is the total rate of energy leaving a surface. The radiosity over a patch is constant. ω' • Units for radiosity: / * meter2 x'

Continuous Radiosity Equation Discrete Radiosity Equation

Discretize the scene into n patches, over which the radiosity is constant reflectivity reflectivity

x n Bx' = Ex' + ρx' ∫ G(x,x') V(x,x') Bx Aj = + ρ Bi Ei i ∑ Fij B j form factor j=1

G: geometry term form factor V: visibility term • discrete representation No analytical solution, • iterative solution x’ even for simple configurations Ai • costly geometric/visibility calculations

The Radiosity Matrix Solving the Radiosity Matrix

n The radiosity of a single patch i is updated for each iteration by = + ρ Bi Ei i ∑ Fij B j gathering radiosities from all other patches: j=1 n simultaneous equations with n unknown Bi values can be written in matrix form:

⎡⎤1−−ρρ111FF 112L − ρ 11 Fn ⎡⎤B1 ⎡⎤E1 ⎢⎥−−ρρFF1 ⎢⎥B ⎢⎥E ⎢⎥221 222 ⎢⎥2 = ⎢⎥2 ⎢⎥MO⎢⎥M ⎢⎥M ⎢⎥⎢⎥ ⎢⎥ ⎣⎦⎢⎥−−ρρnnFF1 LL1 nnn ⎣⎦⎢⎥Bn ⎣⎦⎢⎥En

A solution yields a single radiosity value Bi for each patch in the environment, a view-independent solution. This method is fundamentally a Gauss-Seidel relaxation

5 Computing Vertex Radiosities Questions?

•Bi radiosity values are constant over the extent of a patch. • How are they mapped to the vertex radiosities (intensities) needed by the renderer? – Average the radiosities of patches that contribute to the vertex – Vertices on the edge of a surface are assigned values extrapolation

Factory simulation. Program of Computer Graphics, Cornell University. 30,000 patches.

Today Calculating the Form Factor Fij

• Local Illumination •Fij = fraction of light energy leaving patch j • Why is Global Illumination Important? that arrives at patch i • The • Takes account of both: • Radiosity Equation/Matrix – geometry (size, orientation & position) – visibility (are there any occluders?) • Calculating the Form Factors patch j

patch j patch j

patch i patch i patch i

Calculating the Form Factor Fij Form Factor Determination

The Nusselt analog: the form factor of a patch is equivalent to the fraction of the •Fij = fraction of light energy leaving patch j that arrives at patch i the unit circle that is formed by taking the projection of the patch onto the patch j hemisphere surface and projecting it down onto the circle.

Aj θj r Aj θi

dA patch i i r = 1 F dAi,Aj

1 cos θi cos θj Fij = ∫∫ 2 Vij dAj dAi Ai Ai Aj π r

6 Hemicube Algorithm Form Factor from Ray Casting

• A hemicube is constructed around the center of each patch •Cast n rays between the two patches • Faces of the hemicube are divided into "pixels" – n is typically between 4 and 32 • Each patch is projected (rasterized) onto the faces of the hemicube – Compute visibility • Each pixel stores its pre-computed form factor – Integrate the point-to-point form factor The form factor for a particular • Permits the computation Aj patch is just the sum of the pixels it overlaps of the patch-to-patch • Patch occlusions are form factor, as opposed handled similar to to point-to-patch A z-buffer rasterization i

Questions? Reading for Tuesday 3/4:

• “A Two-Pass Solution to the Rendering Equation: A Synthesis of Ray Tracing and Radiosity Methods” Wallace, Cohen, & Greenberg, SIGGRAPH 1987

• Optional Reading: “The Rendering Equation” Kajiya, SIGGRAPH 1986 Lightscape http://www.lightscape.com

7