Advanced Computer Graphics CSE 163 [Spring 017], Lecture 11 Ravi Ramamoorthi http://www.cs.ucsd.edu/~ravir To Do Assignment due May 19 Should already be well on way. Contact us for difficulties etc. This lecture on rendering, rendering equation. Pretty advanced theoretical material. Don t worry if a bit lost; not directly required on the homeworks. Course Outline Course Outline 3D Graphics Pipeline Modeling (Creating 3D Geometry) Rendering (Creating, shading images from geometry, lighting, materials) 3D Graphics Pipeline Modeling (Creating 3D Geometry) Rendering (Creating, shading images from geometry, lighting, materials) Unit 1: Foundations of Signal and Image Processing Understanding the way D images are formed and displayed, the important concepts and algorithms, and to build an image processing utility like Photoshop Weeks 1 3. Assignment 1 Unit : Meshes, Modeling Weeks 3 5. Assignment Unit 3: Advanced Rendering Weeks 6 7, 8-9. (Final Proect) Unit 4: Animation, Imaging Weeks 7-8, 9-10. (Final Proect) Illumination Models Local Illumination Light directly from light sources to surface No shadows (cast shadows are a global effect) Global Illumination: multiple bounces (indirect light) Hard and soft shadows Reflections/refractions (already seen in ray tracing) Diffuse and glossy interreflections (radiosity, caustics) Diffuse Interreflection Diffuse interreflection, color bleeding [Cornell Bo] Some images courtesy Henrik Wann Jensen 1
Radiosity Caustics Caustics: Focusing through specular surface Maor research effort in 80s, 90s till today Overview of lecture Theory for all global illumination methods (ray tracing, path tracing, radiosity) We derive Rendering Equation [Kaiya 86] Maor theoretical development in field Unifying framework for all global illumination Discuss eisting approaches as special cases Fairly theoretical lecture (but important). Not well covered in tetbooks (though see Eric Veach s thesis). See reading if you are interested. Outline Reflectance Equation Global Illumination Rendering Equation As a general Integral Equation and Operator Approimations (Ray Tracing, Radiosity) Surface Parameterization (Standard Form) Reflection Equation Reflection Equation ) L e ) + L i (, )f (,, )( i n) Emission Incident BRDF Light (from light source) Cosine of Sum over all light sources ) L e ) + L i (, )f (,, )( i n) Emission Incident BRDF Light (from light source) Cosine of
d Reflection Equation L (, ω ) L (, ω ) L(, ω ) f(, ω, ω )cosθdω + Replace sum with integral r r e r i i i r i i Emission Incident BRDF Cosine of Light (from light source) Environment Maps Light as a function of direction, from entire environment Captured by photographing a chrome steel or mirror sphere Accurate only for one point, but distant lighting same at other scene locations (typically use only one env. map) Blinn and Newell 1976, Miller and Hoffman, 1984 Later, Greene 86, Cabral et al. 87 Environment Maps Environment maps widely used as lighting representation Many modern methods deal with offline and real-time rendering with environment maps Image-based comple lighting + comple BRDFs The Challenge L (, ω ) L (, ω ) L(, ω ) f(, ω, ω )cosθdω + r r e r i i i r i i Computing reflectance equation requires knowing the incoming radiance from surfaces But determining incoming radiance requires knowing the reflected radiance from surfaces d Rendering Equation Surfaces (interreflection) da ) L e ) + L (, ω r i i r i i Emission Reflected Light BRDF Cosine of UNKNOWN KNOWN UNKNOWN KNOWN KNOWN Outline Reflectance Equation (review) Global Illumination Rendering Equation As a general Integral Equation and Operator Approimations (Ray Tracing, Radiosity) Surface Parameterization (Standard Form) 3
Rendering Equation (Kaiya 86) Rendering Equation as Integral Equation ) L e ) + L (, ω r i i r i i Emission Reflected Light BRDF Cosine of UNKNOWN l(u) e(u) + KNOWN UNKNOWN KNOWN KNOWN Is a Fredholm Integral Equation of second kind [etensively studied numerically] with canonical form l(v) K(u,v)dv Kernel of equation Linear Operator Theory Linear operators act on functions like matrices act on vectors or discrete representations hu ( ) Mo f ( u) M is a linear operator. ( ) f and h are functions of u a and b are scalars Basic linearity relations hold f and g are functions M o( af + bg) a( M of ) + b( M og) Eamples include integration and differentiation ( K o f )() u k(,) u v f () v dv f ( Do f )( u) ( u) u Linear Operator Equation lu () eu () + lv () Ku (,) v dv Kernel of equation Light Transport Operator L E + KL Can be discretized to a simple matri equation [or system of simultaneous linear equations] (L, E are vectors, K is the light transport matri) Solving the Rendering Equation Too hard for analytic solution, numerical methods Approimations, that compute different terms, accuracies of the rendering equation Two basic approaches are ray tracing, radiosity. More formally, Monte Carlo and Finite Element Monte Carlo techniques sample light paths, form statistical estimate (eample, path tracing) Finite Element methods discretize to matri equation Solving the Rendering Equation General linear operator solution. Within raytracing: General class numerical Monte Carlo methods Approimate set of all paths of light in scene L E + KL IL KL E (I K)L E L (I K) 1 E Binomial Theorem L (I + K + K + K 3 +...)E L E + KE + K E + K 3 E +... Term n corresponds to n bounces of light 4
Ray Tracing L E + KE + K E + K 3 E +... Emission directly From light sources Ray Tracing L E + KE + K E + K 3 E +... Emission directly From light sources Direct Illumination on surfaces Direct Illumination on surfaces Global Illumination (One bounce indirect) [Mirrors, Refraction] OpenGL Shading Global Illumination (One bounce indirect) [Mirrors, Refraction] (Two bounce indirect) [Caustics etc] (Two bounce indirect) [Caustics etc] Outline Reflectance Equation (review) Global Illumination Rendering Equation As a general Integral Equation and Operator Approimations (Ray Tracing, Radiosity) Surface Parameterization (Standard Form) Rendering Equation Surfaces (interreflection) da Change of Variables + f L (, ω ) L (, ω ) L (, ω ) (, ω, ω )cosθ dω r r e r r i i r i i Integral over angles sometimes insufficient. Write integral in terms of surface radiance only (change of variables) ωi ω i : L (, ω ) L (, ω ) + L (, ω ) f(, ω, ω )cosθ dω r d UNKNOWN r e r r i i r i Emission Reflected BRDF Light Cosine of KNOWN UNKNOWN KNOWN KNOWN i θ i θ o d dωi 5
Change of Variables + f L (, ω ) L (, ω ) L (, ω ) (, ω, ω )cosθ dω r r e r r i i r i i Integral over angles sometimes insufficient. Write integral in terms of surface radiance only (change of variables) cosθi L (, ω ) L (, ω ) + L (, ω ) f(, ω, ω ) r r e r r i i r all visible to dωi cosθi G (, ) G (, ) Rendering Equation: Standard Form Lr(, ωr) Le(, ωr) + Lr(, ωi) f(, ωi, ωr)cosθidωi Integral over angles sometimes insufficient. Write integral in terms of surface radiance only (change of variables) cosθi Lr(, ωr) Le(, ωr) + Lr(, ωi) f(, ωi, ωr) all visible to Domain integral awkward. Introduce binary visibility fn V L (, ω) L (, ω) + L (, ω) f(, ωω, ) G( V, ) (, ) r r e r r all surfaces i i r Same as equation.5 Cohen Wallace. It swaps primed And unprimed, omits angular args of BRDF, - sign. Same as equation above 19.3 in Shirley, ecept he has no emission, slightly diff. notation dωi cosθi G (, ) G (, ) Radiosity Equation L (, ω) L (, ω) + L (, ω) f(, ωω, ) G( V, ) (, ) r r e r r all surfaces i i r Drop angular dependence (diffuse Lambertian surfaces) L ( ) L ( ) + f( ) L ( ) G( V, ) (, ) r e r S Change variables to radiosity (B) and albedo (ρ) GV (, ) (, ) B ( ) E ( ) + ρ( ) B ( ) S Epresses conservation of light energy at all points in space Same as equation.54 in Cohen Wallace handout (read sec.6.3) Ignore factors of which can be absorbed. Discretization and Form Factors GV (, ) (, ) B ( ) E ( ) + ρ( ) B ( ) A E i + ρ i B F i S F is the form factor. It is dimensionless and is the fraction of energy leaving the entirety of patch (multiply by area of to get total energy) that arrives anywhere in the entirety of patch i (divide by area of i to get energy per unit area or radiosity). A i Form Factors Matri Equation θ i r θ da A A E i + ρ i B F i GV (, ) (, ) AiFi AF i daida A i da i GV (, ) (, ) AiFi AF i daida cosθi G (, ) G (, ) A i ρ i B F i E i E i + ρ i B F i M i B E i MB E M i I i ρ i F i 6
Summary Theory for all global illumination methods (ray tracing, path tracing, radiosity) We derive Rendering Equation [Kaiya 86] Maor theoretical development in field Unifying framework for all global illumination Discuss eisting approaches as special cases 7