02/05/03© 2003 university of wisconsin last time importance better form factors meshing

30
02/05/03 © 2003 University of Wisc onsin Last Time • Importance Better Form Factors • Meshing

Upload: shauna-mckinney

Post on 16-Jan-2016

216 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: 02/05/03© 2003 University of Wisconsin Last Time Importance Better Form Factors Meshing

02/05/03 © 2003 University of Wisconsin

Last Time

• Importance

• Better Form Factors

• Meshing

Page 2: 02/05/03© 2003 University of Wisconsin Last Time Importance Better Form Factors Meshing

02/05/03 © 2003 University of Wisconsin

Today

• Different Basis Functions

• Multi-pass Methods involving the Radiosity Equation

Page 3: 02/05/03© 2003 University of Wisconsin Last Time Importance Better Form Factors Meshing

02/05/03 © 2003 University of Wisconsin

Errata

• I mistakenly described “gathering to a pixel”

• To gather to a pixel:– Cast a ray from the eye, through the pixel, to find the surface point

seen through the pixel, x

– Gather radiosity to that point:

– Render the result, Bx

N

jjjxxxx BFEB

1,

Page 4: 02/05/03© 2003 University of Wisconsin Last Time Importance Better Form Factors Meshing

02/05/03 © 2003 University of Wisconsin

Discontinuity Meshing

• Identify expected discontinuities and mesh around them– Sharp boundaries due to point light

sources or object contact

– Derivative discontinuities due to area sources and multi-object shadows

• Related to aspect graphs in computer vision– Places where the set of visible

things changes

Page 5: 02/05/03© 2003 University of Wisconsin Last Time Importance Better Form Factors Meshing

02/05/03 © 2003 University of Wisconsin

Two Types of Discontinuities

• Assume polygonal environment• Vertex-Edge events

– Discontinuities where the plane defined by a vertex and an edge intersects other objects

– Vertex on light source, edge on blocker– Discontinuity is 0th or 1st order

• Edge-Edge-Edge– Higher order discontinuities at places where three edges appear to

meet at a point– Produce quadric curves as shadow boundaries, which are hard to

mesh– 2nd order, generally ignored

Page 6: 02/05/03© 2003 University of Wisconsin Last Time Importance Better Form Factors Meshing

02/05/03 © 2003 University of Wisconsin

Meshing With Discontinuities

• Construct VE planes

• Intersect them with surfaces

• Mesh the resulting edges– Constrained triangulation is a difficult problem

• Mesh must be able to store different radiosity values at one point, because radiosity is different on each side of the edge

Page 7: 02/05/03© 2003 University of Wisconsin Last Time Importance Better Form Factors Meshing

02/05/03 © 2003 University of Wisconsin

Using Discontinuity Meshes

• Very high number of possible discontinuities: O(n6) for n vertices

• Only find 0th and 1st order discontinuities due to bright light sources

• Try to only find visible discontinuities

• Research topic?: Integrate into hierarchical scheme– Use discontinuities as splitting planes in hierarchy

– Hierarchy would be BSP tree

– Not really a big pay-off, research targets have moved on

Page 8: 02/05/03© 2003 University of Wisconsin Last Time Importance Better Form Factors Meshing

02/05/03 © 2003 University of Wisconsin

Better Radiosity Representations

• Standard approach: Each point takes on the value of the patch on which it lies:

• Finite Element Approach: The radiosity at each point is given by a linear combination of basis functions evaluated at that point:

– Typically, most basis functions are 0 at most points

– Standard formulation is like having one basis function for each patch that is constant on the patch and 0 elsewhere

jj PxjBxB : with)(

)()(1

xNBxB j

m

j j

Page 9: 02/05/03© 2003 University of Wisconsin Last Time Importance Better Form Factors Meshing

02/05/03 © 2003 University of Wisconsin

Finite Element Formulation

• Note the similarity to splines: a set of weights multiply a set of basis functions to give a value

• Choose a set of basis functions that can capture the desired behavior– Linear, quadratic, …

• Find the coefficients, Bj, that give the best solution– Two common, different definitions of “best”

Page 10: 02/05/03© 2003 University of Wisconsin Last Time Importance Better Form Factors Meshing

02/05/03 © 2003 University of Wisconsin

Galerkin Method

• Find the set of weights that minimize the variation of the found solution from the true solution

• In other words: Find the closest expressible solution to the true one

• The standard radiosity equation, with accurate form factors, is a Galerkin method with constant basis functions of finite support (supported by each patch)

Page 11: 02/05/03© 2003 University of Wisconsin Last Time Importance Better Form Factors Meshing

02/05/03 © 2003 University of Wisconsin

Point-Collocation Method

• Find the set of weights that zero the error at a fixed set of points

• The hemicube algorithm implements a point-collocation method for the radiosity equation– At which points does it zero the error?

• Not as accurate as the Galerkin method:– Only locally accurate, as opposed to globally optimal

Page 12: 02/05/03© 2003 University of Wisconsin Last Time Importance Better Form Factors Meshing

02/05/03 © 2003 University of Wisconsin

Alternate Bases

• Linear basis functions

• Wavelets:– Multi-resolution representation

– Behaves like hierarchical radiosity, but without redundant information

• No need for push/pull in hierarchy

• Recently, working with frequency decompositions of radiosity on surfaces

Page 13: 02/05/03© 2003 University of Wisconsin Last Time Importance Better Form Factors Meshing

02/05/03 © 2003 University of Wisconsin

The Perfectly Diffuse Assumption

• Standard radiosity assumes perfectly diffuse surfaces:– We can use radiosity instead of radiance

– No directional energy concern• Doesn’t matter where the energy comes from

• Doesn’t matter which direction it leaves in

• Specularities are missing:– No mirrors (ideal specular)

• Not so common, but very important in some environments

– No highlights (directional diffuse)• These are very common

Page 14: 02/05/03© 2003 University of Wisconsin Last Time Importance Better Form Factors Meshing

02/05/03 © 2003 University of Wisconsin

Adding Specular Transfer

• Several approaches:– Discretize position and direction on each surface, and solve for

(x,) couples

– Monte-Carlo variants (next week)

– Simple 2-pass approaches

– More complete 2-pass approaches

Page 15: 02/05/03© 2003 University of Wisconsin Last Time Importance Better Form Factors Meshing

02/05/03 © 2003 University of Wisconsin

Discretizing Radiance

• Each patch stores directional radiance arriving from a number of discrete directions, j=(j,j)– Use a global cube to store values

– A global cube is like a hemicube, but radiance values are stored at the “pixels”

• New transfer equation:

j

dwLxxLLlk jjvjlkj

bdlkekl cos),,(),( , )(

Page 16: 02/05/03© 2003 University of Wisconsin Last Time Importance Better Form Factors Meshing

02/05/03 © 2003 University of Wisconsin

Solving for Directional Radiance

• Use a progressive refinement algorithm• The shooting patch, for each out direction:

– Looks up the visible patch– Sums the incoming radiance from all directions,

multiplied by the BRDF– Shoots the result to the visible patch

• Generate image using directional information providing by ray tracing– For each point seen through a pixel, look up

nearby global cubes for incoming ray direction, and interpolate results

Page 17: 02/05/03© 2003 University of Wisconsin Last Time Importance Better Form Factors Meshing

02/05/03 © 2003 University of Wisconsin

Problems with Directional Radiance

• Massive amount of data for reasonable results

• Aliases and fails to capture, or blurs, tight highlights

• Long computation times

• Solution: View dependent approaches

Page 18: 02/05/03© 2003 University of Wisconsin Last Time Importance Better Form Factors Meshing

02/05/03 © 2003 University of Wisconsin

Classifying Light Paths

• Use regular expression syntax to classify reflections between light and eye

• All paths are L(D|S)*E

• Radiosity does LD*E

• Raytracing does LDS*E

Page 19: 02/05/03© 2003 University of Wisconsin Last Time Importance Better Form Factors Meshing

02/05/03 © 2003 University of Wisconsin

Two Pass Approaches

• Specularities are often highly localized in terms of both position and viewing angle– Few are likely to be important for any given view

• Directional radiance computes all directions, regardless of their importance

• Two pass approaches compute the non-directional component in one pass, and the strongly directional component in a second pass

Page 20: 02/05/03© 2003 University of Wisconsin Last Time Importance Better Form Factors Meshing

02/05/03 © 2003 University of Wisconsin

Simple Two-Pass Approaches

• Radiosity first pass with ray traced second pass– Radiosity captures diffuse interactions– Ray tracing captures mirror effects and

specularities due directly to sources– Which light paths?– Qualitatively, what does it get wrong?

• Radiosity first pass with Phong second pass– Cheap, incorrect, but can look good for

certain scenes (which ones?)

Page 21: 02/05/03© 2003 University of Wisconsin Last Time Importance Better Form Factors Meshing

02/05/03 © 2003 University of Wisconsin

Complete Two-Pass Method

• Works for ideal specularities

• First pass computes specular paths between emitters and other patches– Extend form factors

• Second pass computes specular paths from the eye to patches– Ray trace from eye into scene

Page 22: 02/05/03© 2003 University of Wisconsin Last Time Importance Better Form Factors Meshing

02/05/03 © 2003 University of Wisconsin

Extended Form Factors

• Define the extended form factor, Fijext to be the proportion of the total

power leaving patch Pi that reaches patch Pj after any number of specular bounces

• Replace form factors in regular radiosity equation with extended form factors

• All specular bounces between emitters and receivers will be taken into account (correctly)

Page 23: 02/05/03© 2003 University of Wisconsin Last Time Importance Better Form Factors Meshing

02/05/03 © 2003 University of Wisconsin

Computing Extended Form Factors

• Standard methods can be used to render mirror effects with a hemicube and z-buffer– Treat mirrors as windows into

reflected world– Multi-pass method (can also do

refraction)

• Ray tracing for form factors can be trivially extended

• Must take into account specular reflection coefficients

Page 24: 02/05/03© 2003 University of Wisconsin Last Time Importance Better Form Factors Meshing

02/05/03 © 2003 University of Wisconsin

Second Pass

• Must account for specular reflectors seen by the eye

• Ray tracing, or multi-pass z-buffer

• For correct results, should match method used for extended form factor, so that the effects captured are consistent

Page 25: 02/05/03© 2003 University of Wisconsin Last Time Importance Better Form Factors Meshing

02/05/03 © 2003 University of Wisconsin

Directional Diffuse BRDF

• Reflectance has a smooth variation with angle. Most real surfaces are like this

• Use a smooth, compact representation for radiance at each patch

• Take distribution into account when gathering or shooting

• Still use second pass for ideal specular effects

Page 26: 02/05/03© 2003 University of Wisconsin Last Time Importance Better Form Factors Meshing

02/05/03 © 2003 University of Wisconsin

Directional Diffuse Reflectance

• Surfaces with directional diffuse reflectance diffusely reflect some light, and roughly specularly reflect some other– Very common surfaces– The Phong shading model is aimed at such surfaces

• Good representation for BRDF and outgoing radiance is spherical harmonics– Like Fourier decomposition, but over sphere

Isotropic surfaces: Angle doesn’t matter

Page 27: 02/05/03© 2003 University of Wisconsin Last Time Importance Better Form Factors Meshing

02/05/03 © 2003 University of Wisconsin

Solving with Directional Diffuse

• Easiest with a progressive radiosity algorithm• Shooting surfaces identify visible patches, somehow

– Hemi-cube or ray casting methods

• Shoot appropriate amount of radiance to each surface– Recompose outgoing radiance from spherical harmonics

• Each receiving surface adds a scaled, rotated version of its BRDF to its own outgoing radiance– Scaling and weighting determined by incoming radiance magnitude and

direction

Page 28: 02/05/03© 2003 University of Wisconsin Last Time Importance Better Form Factors Meshing

02/05/03 © 2003 University of Wisconsin

Participating Media

• We assumed that we were operating in a near-vacuum– Radiosity was not attenuated along lines

– Radiosity was only calculated at surfaces

• Participating media (fog, smoke, clouds) are frequently important

Page 29: 02/05/03© 2003 University of Wisconsin Last Time Importance Better Form Factors Meshing

02/05/03 © 2003 University of Wisconsin

Volumetric Effects

• Emission– Energy generated by the volume

(flame, sun)

• Absorption– Energy lost to the volume

• Out-scattering– Energy scattered out of a volume

• In-scattering– Energy scattered into a volume from

the neighborhood

Page 30: 02/05/03© 2003 University of Wisconsin Last Time Importance Better Form Factors Meshing

02/05/03 © 2003 University of Wisconsin

Next Time

• Participating media discussion

• Details on implementing the next assignment

• Next week, Monte Carlo methods