
CS 87/187, Spring 2016 RENDERING ALGORITHMS Global Illumination I: Path Tracing http://www.graphics.cornell.edu/online/box/compare.html Prof. Wojciech Jarosz [email protected] (with some slides by Jan Novák and Wenzel Jakob) Control variates off Last time • Variance reduction using – Control variates – Careful sample placement Random Stratified N-Rooks Control variates on Multi-Jittered Quasi-Random Poisson-Disc Rendering Algorithms Spring 2016 2 Today’s Menu • Light paths • Heckbert notation • Rendering Equation • Solving the Rendering Equation – Recursive Monte Carlo ray tracing – Path tracing Rendering Algorithms Spring 2016 3 Color Bleeding James Gurney Rendering Algorithms Spring 2016 4 Color Bleeding Sculpture by John Ferren All visible surfaces are painted white, the color is only due to inter-reflections Rendering Algorithms Spring 2016 5 Caustics Rendering Algorithms Spring 2016 source: Flickr 6 Subsurface Scattering flickr.com http://www.math.psu.edu/jech Rendering Algorithms Spring 2016 7 All-in-One! Ritschel et al. [2012] Rendering Algorithms Spring 2016 8 Simulating Global Illumination http://www.graphics.cornell.edu/online/box/compare.html One image here was captured from a physical model under controlled lighting conditions using a Photometrics CCD camera. The other image was rendered using a geometric model with material properties and lighting set to values identical to the physical conditions. Which one is which? Rendering Algorithms Spring 2016 9 Light Paths Rendering Algorithms Spring 2016 10 Light Paths • Express light paths in terms of the surface interactions that have occurred • A light path is a chain of linear segments joined at event “vertices” Rendering Algorithms Spring 2016 11 Heckbert’s Classification • Classification of “vertices”: – : a light source – : the eye – : a specular reflection – : a diffuse reflection classification by Paul Heckbert Rendering Algorithms Spring 2016 12 Heckbert’s Classification Light source Eye Specular Image plane Diffuse Rendering Algorithms Spring 2016 13 Heckbert’s Classification Light source Eye Specular Image plane Diffuse Rendering Algorithms Spring 2016 14 Heckbert’s Classification Light source Eye Specular Image plane Diffuse Rendering Algorithms Spring 2016 15 Heckbert’s Classification Light source Eye Specular Image plane Diffuse Rendering Algorithms Spring 2016 16 Heckbert’s Classification Light source Eye Specular Image plane Diffuse Rendering Algorithms Spring 2016 17 Heckbert’s Classification Light source Eye Specular Image plane Diffuse Rendering Algorithms Spring 2016 18 Heckbert’s Classification • Can express arbitrary classes of paths using a regular expression type syntax: – : one or more of event – : zero or more of event – : zero or one events – : a or event Rendering Algorithms Spring 2016 19 Heckbert’s Classification • Direct illumination: • Indirect illumination: • Classical (Whitted-style) ray tracing: Rendering Algorithms Spring 2016 20 Heckbert’s Classification • Direct illumination: • Indirect illumination: • Classical (Whitted-style) ray tracing: • Full global illumination: – diffuse inter-reflections: – caustics: Rendering Algorithms Spring 2016 21 Ray Tracing Rendering Algorithms Spring 2016 22 Beyond Ray Tracing Wojciech Jarosz Ray-traced Real Rendering Algorithms Spring 2016 23 What is Indirect Illumination? Rendering Algorithms Spring 2016 24 What is Indirect Illumination? Rendering Algorithms Spring 2016 25 What is Indirect Illumination? Rendering Algorithms Spring 2016 26 What is Indirect Illumination? Rendering Algorithms Spring 2016 27 What is Indirect Illumination? Rendering Algorithms Spring 2016 28 What is Indirect Illumination? Rendering Algorithms Spring 2016 29 Direct Illumination Rendering Algorithms Spring 2016 30 Direct + Indirect Illumination Rendering Algorithms Spring 2016 31 Indirect Illumination Rendering Algorithms Spring 2016 32 Reflection Equation • reflected radiance depends on incident radiance Rendering Algorithms Spring 2016 33 Rendering Equation • James Kajiya, “The Rendering Equation.” SIGGRAPH 1986. • Energy equilibrium: outgoing emitted reflected Rendering Algorithms Spring 2016 34 Light Transport • No participating media → radiance is constant along ray • We can relate incoming radiance to outgoing radiance x ray tracing function Rendering Algorithms Spring 2016 35 Rendering Equation • Hemispherical form ray tracing function • Only outgoing radiance (except for ) on both sides – we drop the “o” subscript – Fredholm equation of the second kind (recursive) Rendering Algorithms Spring 2016 36 Rendering Equation • Surface area form Rendering Algorithms Spring 2016 37 Rendering Equation • How to evaluate these integrals? • Closed-form solution almost never exists – multidimensional, complex BRDF – discontinuous integrand (visibility) • Numerical Methods – Gaussian quadrature – curse of dimensionality → inefficient Rendering Algorithms Spring 2016 38 Solving the Rendering Equation • Monte Carlo methods – Today: unbiased methods • Recursive Monte Carlo ray tracing • Path tracing and light tracing • Bidirectional path tracing – Later: biased methods • Many-light algorithms • Density estimation • (Probabilistic) progressive photon mapping • Irradiance caching Rendering Algorithms Spring 2016 39 Solving the Rendering Equation Rendering Algorithms Spring 2016 40 Solving the Rendering Equation Rendering Algorithms Spring 2016 41 Solving the Rendering Equation Rendering Algorithms Spring 2016 42 Solving the Rendering Equation How do we get these? Rendering Algorithms Spring 2016 43 Recursive Monte Carlo Ray Tracing Rendering Algorithms Spring 2016 44 Solving the Rendering Equation Rendering Algorithms Spring 2016 45 Solving the Rendering Equation Rendering Algorithms Spring 2016 46 Recursive Monte Carlo Ray Tracing Rendering Algorithms Spring 2016 47 Partitioning the Integrand • Direct illumination: sometimes better estimated by sampling emissive surfaces • Let’s estimate direct illumination separately from indirect illumination, then add the two – i.e. shoot shadow rays (direct lighting) and gather rays (indirect lighting) – be careful not to double-count! • Explicit estimation of direct illumination is also known as next-event estimation Rendering Algorithms Spring 2016 48 Recursive Monte Carlo Ray Tracing with explicit shadow rays ✘ Avoid ✘ double counting! L(x, ~! )=Le(x, ~! )+Ld(x, ~! )+Li(x, ~! ) L(x, ~! )=Le + ...Le ...dA(x0)+ ...L...d~! 0 2 ZA ZH Rendering Algorithms Spring 2016 49 Monte Carlo Ray Tracing Algorithm L(x, ~! )=Le(x, ~! )+Ld(x, ~! )+Li(x, ~! ) color shade (point x, normal n) { for all lights // direct illumination Ld += contribution from light; for all N indirect sample rays // indirect illumination ω’ = random direction in hemisphere above n; Li += brdf * shade(trace(x, ω’)) * dot(n, ω’) / (p(ω’) * N); if not last bounce specular // prevent double-counting return Ld + Li; return Le + Ld + Li; } Rendering Algorithms Spring 2016 50 Monte Carlo Ray Tracing Algorithm L(x, ~! )=Le(x, ~! )+Ld(x, ~! )+Li(x, ~! ) color shade (point x, normal n) { for all lights // direct illumination Ld += contribution from light; for all N indirect sample rays // indirect illumination ω’ = random direction in hemisphere above n; Li += brdf * shade(trace(x, ω’)) * dot(n, ω’) / (p(ω’) * N); if not last bounce specular // prevent double-counting return Ld + Li; return Le + Ld + Li; } Rendering Algorithms Spring 2016 51 Monte Carlo Ray Tracing Algorithm L(x, ~! )=Le(x, ~! )+Ld(x, ~! )+Li(x, ~! ) color shade (point x, normal n) { for all lights // direct illumination Ld += contribution from light; for all N indirect sample rays // indirect illumination ω’ = random direction in hemisphere above n; Li += brdf * shade(trace(x, ω’)) * dot(n, ω’) / (p(ω’) * N); if not last bounce specular // prevent double-counting return Ld + Li; return Le + Ld + Li; } Rendering Algorithms Spring 2016 52 Monte Carlo Ray Tracing Algorithm L(x, ~! )=Le(x, ~! )+Ld(x, ~! )+Li(x, ~! ) color shade (point x, normal n) { for all lights // direct illumination Ld += contribution from light; for all N indirect sample rays // indirect illumination ω’ = random direction in hemisphere above n; Li += brdf * shade(trace(x, ω’)) * dot(n, ω’) / (p(ω’) * N); if last bounce not specular // prevent double-counting return Ld + Li; return Le + Ld + Li; } Rendering Algorithms Spring 2016 53 Monte Carlo Ray Tracing Algorithm • Formulation of is recursive! • Can you see any problem? ... • Exponential growth! • 3-bounce contributes less than 1-bounce transport, but we estimate it with 25× as many samples! Rendering Algorithms Spring 2016 54 Path Tracing Rendering Algorithms Spring 2016 55 Path Tracing Rendering Algorithms Spring 2016 56 Path Tracing with Shadow Rays Avoid ✘ double counting! L(x,~!)=Le(x,~!)+ ...Le ...dA(x0)+ ...L...d~!0 2 ZA ZH Rendering Algorithms Spring 2016 57 Path Tracing with Shadow Rays 1 path/pixel Rendering Algorithms Spring 2016 58 Path Tracing with Shadow Rays 4 paths/pixel Rendering Algorithms Spring 2016 59 Path Tracing with Shadow Rays 16 paths/pixel Rendering Algorithms Spring 2016 60 Path Tracing with Shadow Rays 64 paths/pixel Rendering Algorithms Spring 2016 61 Path Tracing with Shadow Rays 256 paths/pixel Rendering Algorithms Spring 2016 62 Path Tracing with Shadow Rays 1024 paths/pixel Rendering Algorithms Spring 2016 63 Monte Carlo Ray Tracing Algorithm L(x, ~! )=Le(x, ~! )+Ld(x, ~! )+Li(x, ~! ) color shade (point x, normal n) { for all lights // direct illumination Ld += contribution from light; for all N indirect sample rays // indirect
Details
-
File Typepdf
-
Upload Time-
-
Content LanguagesEnglish
-
Upload UserAnonymous/Not logged-in
-
File Pages85 Page
-
File Size-