{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}


lecture17-1 - CS 445 645 Introduction to Computer Graphics...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: CS 445 / 645 Introduction to Computer Graphics Lecture 17 Radiosity Assignment Four Write a ray tracer You’ll have complete control • Input file format • User interface • Data structures • Form a two-person group From Fall ‘03 Shane Liesegang William Kammersell Adam Jones, Richard Sun Raytracing vs. Radiosity Both accomplish global illumination • Raytracing – Follow rays of energy as they bounce through a scene Which rays? Which Pick some. Randomness helps. Monte Carlo. Still a research topic. Monte How many rays? How Derek Juba and Matt Helton UVa Intro to Gaphics, Fall 2003 Depends on the scene. Still a topic of research debate. topic Courtyard House with Curved Elements Complex Indirect Illumination Mies van der Rohe Modeling: Stephen Duck; Rendering: Henrik Wann Jensen Raytracing vs. Radiosity Both accomplish global illumination • Radiosity – Compute energy transfer between finite-sized patches of surfaces in the scene Which patches? Must subdivide the scene Must somehow How does energy transfer between patches? Approximating models Still an area of research Which is better? Raytraced Herik Wann Jensen Radiosity • Radiosity captures the sum of light transfer well – But it models all surfaces as diffuse reflectors – Can’t model specular reflections or refraction Images are viewpoint independent • Raytracing captures the complex behavior of light rays as they reflect and Raytracing refract refract – Works best with specular surfaces. Why? Diffuse surface converts light ray into many. Ray tracing follows Diffuse one ray and does not capture the full effect of the diffusion. one Must use ambient term to replace absent diffusion Lighting Example: Cornell Box Surface Color Lighting Example: Diffuse Reflection Surface Color Diffuse Shading Lighting Example: Shadows No Shadows Shadows Lighting Example: Soft Shadows Hard Shadows Point Light Source Soft Shadows Area Light Source Radiosity: Cornell Experment Measured Simulated Program of Computer Graphics Cornell University Radiosity: Cornell Experiment Measured Simulated Difference Very Early Radiosity Parry Moon and Domina Spencer Lighting Design (1948 ­ MIT) Very Early Radiosity Goral et al. 1984. • Note the color bleeding Early Radiosity Shenchang Eric Chang et al., Cornell 1988 The ‘Rendering Equation’ Jim Kajiya (Current head of Microsoft Research) developed this in Jim 1986 1986 I ( x, x') = g ( x, x ') ε ( x, x') + ∫ ρ( x, x' , x' ') I ( x' , x' ') dx ' ' S I(x, x’) is the total intensity from point x’ to x g(x, x’) = 0 when x/x’ are occluded and 1/d2 otherwise (d = distance between x and x’) between ε (x, x’) is the intensity emitted by x’ to x ρ (x, x’,x’’) is the intensity of light reflected from x’’ to x through x’ S is all points on all surfaces Radiosity All surfaces are assumed perfectly diffuse • What does that mean about property of lighting in scene? – Light is reflected equally in all directions • Same lighting independent of viewing angle / location – Only a subset of the Rendering Equation Diffuse-diffuse surface lighting effects possible Radiosity Terms Radiant power [flux] (Φ ) • Rate at which light energy is transmitted (in watts = joules/sec). Radiant Intensity (I) • Power radiated onto a unit solid angle in direction Power (in watts/steradian) (in Radiance (L) • Intensity per unit projected surface area Intensity (in watts/m2steradian) (in Irradiance (E) • Incident flux density on a locally planar area Incident (in watts/m2 ) (in Radiosity (B) • Exitant flux density from a locally planar area (in watts/ m 2 ) Basic elements of radiosity Assume surface is Lambertian • dB is the visible radiant flux emanating dB from the surface point in the direction given by the angles θ and φ within a differential solid angle dω per unit time, differential per unit of surface area per Basic elements of radiosity The intensity, I • The diffuse radiation in direction (θ, φ) – Radiant energy Radiant per unit time per projected area per unit solid angle I dB d! Á Basis elements of radiosity We have the intensity of radiance in a given We direction with a given solid angle… direction How will we compute the radiation How for all directions? for Z B hemispher e dB Radiosity equation Bk – total rate of radiant energy leaving surface k per unit area Hk – sum of the radiant energy contributions from all surfaces in the rendered volume arriving all at surface k per unit time per unit area Hk X j B j Fj k Form Factor Form factor, Fjk The fractional amount of radiant energy from The surface j that reaches surface k surface We’ll discuss different form factor approximations later. Radiosity equation Permit surface k to emit light: Bk E k Hk Hk X j B j Fj k Ek = 0 if surface k is not a light Ek = rate of energy emitted by surface k per unit area (watts/m2) area Radiosity equation Permit surface k to have variable reflectance B k E k ½H k k ρ k is the reflectivity factor for surface k (percent of incident light that is reflected in all directions) incident Radiosity equation For a single surface, k Bk E k ½ k X j Bj Fj k • Note: Fkk = 0 because planar and convex surfaces cannot “see” themselves “see” How will we compute this for all surfaces? Radiosity equation Obtaining illumination effects for all surfaces in Obtaining the rendered volume the X Bk E k ½ Bj Fj k k • Find Bk for all surfaces, k • What do we know ahead of time? – Ek, ρk, Fjk j Radiosity equation Consider three surfaces B : B F ; B F ; B : B F ; B F ; B : B F ; B F ; Three equations and three unknowns! Consider three surfaces B B : B F ; B F ; : B F ; B F ; B : B F ; B F ; 2 3 Move terms around 2 B ¡ : B F ; ¡ : B F ; ¡ : B F ; B ¡ : B F ; ¡ : B F ; ¡ : B F ; B 32 3 ¡ : F ; ¡ : F ; B 6 7 6 76 7 ¡ : F ; 5 4 B 5 4 5 4 ¡ : F ; ¡ : F ; ¡ : F ; B Invert and solve for B vector Extending to more surfaces Remember, Fk,k = 0 Solving for all Patches Difficult to perform Gaussian Illumination and Difficult solve for b (size of F is large but sparse – why?) why? Instead, iterate: Instead, bk+1 = e – Fbk • Multiplication of sparse matrix is O(n), not O(n2) • Stop when bk+1 = bk Back to the Form Factors Fij = energy transfer from surface i to j energy = percent of energy emanating from i that is incident on j F i;j This is a good image from Foley et al. Note theta in the image corresponds to phi in our Hearn and Baker. Form factors Consider the differential units • For some small area of surface i and some small area of j F i;j d! F dA i ;dA j I i B µidA dA i i i Form factors d! F dA i ;dA j I i B µidA dA i i i d! F dA i ;dA j dA r r µj dA j r I i µi dA i µj dA j B i dA i Remember, theta from our example = phi from the images and Remember, examples of Hearn and Baker examples dA Form factors F dA i ;dA j I i µi dA i µj dA j B i dA i F dA i ;dA j I i µi dA i µj dA j I i ¼ dA i r F dA i ;dA j µi µj dA j ¼ r Form factors Visibility factor Final answer R F i;j R µi µj sur f i surf j ¼ r Ai V dA i dA j Normalize for the size of patch A_i Form Factor – Another image Spherical projections to model form factor • project polygon Aj on unit hemisphere centered at (and tangent to) Ai – Contributes cosθj / r2 • Project this projection to Project base of hemisphere base – Contributes cosθi • Divide this area by area Divide of circle base of – Contributes π(1 2 ) Contributes π(1 dFdi ,dj = cosθi cos θ j πr 2 H ij dA j Form Factor – Another Model Hemicube allows faster computations • Analytic solution of hemisphere is expensive • Use rectangular approximation, hemicube Use hemicube • cosine terms for top and sides cosine are simplified are • Dimension of 50 – 200 squares Dimension is good is BRDFs Bidirectional Reflection Distribution Function • Models how much light is reflected in direction ω0 from Models direction ωi • These functions can be predefined for a surface to facilitate These the computation of the form factors the – How much light reflects in some given direction? – Take light coming from all incoming directions, multiply it Take by the BRDF, multiply by cos(θ) by Radiosity Radiosity is expensive to compute • Get your PhD by improving it Some parts of illuminated world can change • Emitted light • Viewpoint Other things cannot • Light angles • Object positions and occlusions • Computing form factors is expensive Specular reflection information is not modeled View-dependent vs View-independent Ray-tracing models specular reflection well, but Ray-tracing diffuse reflection is approximated diffuse Radiosity models diffuse reflection accurately, but Radiosity specular reflection is ignored ignored Advanced algorithms Advanced combine the two combine Aliasing in radiosity Non-axis aligned meshes Doing a better job with discontinuities Engine Room Architectural design ...
View Full Document

{[ snackBarMessage ]}