Computer Graphics - Volume Rendering - Pascal Grittmann, Jaroslav K řivánek Using pictures from: Monte Carlo Methods for Physically Based Volume Rendering ; SIGGRAPH 2018 Course; Jan Novák, Iliyan Georgiev, Johannes Hanika, Jaroslav Křivánek , Wojciech Jarosz
Overview • So far: • Light interactions with surfaces • Assume vacuum in and around objects • This lecture: • Participating media • How to represent volumetric data • How to compute volumetric lighting effects • How to implement a very basic volume renderer 06.12.2018 CG - Volume Rendering - Pascal Grittmann, Jaroslav Křivánek 2
06.12.2018 3
06.12.2018 4
06.12.2018 5
06.12.2018 6
06.12.2018 7
Fundamentals 06.12.2018 CG - Volume Rendering - Pascal Grittmann, Jaroslav Křivánek 8
Volumetric Effects • Light interacts not only with surfaces but everywhere inside! • Volumes scatter, emit, or absorb light http://coclouds.com http://wikipedia.org http://commons.wikimedia.org 06.12.2018 CG - Volume Rendering - Pascal Grittmann, Jaroslav Křivánek 9
Approximation: Model Particle Density • Modeling individual particles of a volume is, of course, not practical • Instead, represent statistically using the average density • (Same idea as, e.g., microfacet BSDFs) 06.12.2018 CG - Volume Rendering - Pascal Grittmann, Jaroslav Křivánek 10
Volume Representation • Many possibilities (particles, voxel octrees, procedural, … ) • A common approach: Scene objects can “contain” a volume 06.12.2018 CG - Volume Rendering - Pascal Grittmann, Jaroslav Křivánek 11
Volume Representation • Homogeneous: • Constant density • Constant absorption, scattering, emission, • Constant phase function (later) • Heterogeneous: • Coefficients and/or phase function vary across the volume • Can be represented using 3D textures • (e.g., voxel grid, procedural) http://wikipedia.org 06.12.2018 CG - Volume Rendering - Pascal Grittmann, Jaroslav Křivánek 12
Data Acquisition • Real-world measurements via tomography • Simulation, e.g., • Fluids, • Fire and smoke, • Fog https://docs.blender.org 06.12.2018 CG - Volume Rendering - Pascal Grittmann, Jaroslav Křivánek 13
Simulating Volumes Mathematical Formulation of Volumetric Light Transport 06.12.2018 CG - Volume Rendering - Pascal Grittmann, Jaroslav Křivánek 14
So far: Assume Vacuum • Compute 𝑀 𝑝 (𝑦, 𝜕 𝑝 ) using the rendering equation 𝑦 06.12.2018 CG - Volume Rendering - Pascal Grittmann, Jaroslav Křivánek 15
Volume Absorbs and Scatters Light • Compute 𝑀 𝑝 (𝑦, 𝜕 𝑝 ) using the rendering equation • Only a fraction 𝑈 𝑏, 𝑐 𝑀 𝑝 𝑦, 𝜕 𝑝 arrives at the eye 𝑐 𝑏 𝑦 06.12.2018 CG - Volume Rendering - Pascal Grittmann, Jaroslav Křivánek 16
Volume Emits Light • Compute 𝑀 𝑝 (𝑦, 𝜕 𝑝 ) using the rendering equation • Only a fraction 𝑈 𝑏, 𝑐 𝑀 𝑝 𝑦, 𝜕 𝑝 arrives at the eye • Every point 𝑨 between 𝑏 and 𝑐 might emit light 𝑐 𝑏 𝑦 𝑨 06.12.2018 CG - Volume Rendering - Pascal Grittmann, Jaroslav Křivánek 17
Volume Scatters Light • Compute 𝑀 𝑝 (𝑦, 𝜕 𝑝 ) using the rendering equation • Only a fraction 𝑈 𝑏, 𝑐 𝑀 𝑝 𝑦, 𝜕 𝑝 arrives at the eye • Every point 𝑨 between 𝑏 and 𝑐 might emit light • Every point 𝑨 might be illuminated through the volume 𝑐 𝑏 𝑦 𝑨 06.12.2018 CG - Volume Rendering - Pascal Grittmann, Jaroslav Křivánek 18
𝑐 𝑏 𝑦 𝑀 𝑗 = ? 𝑀 0 𝑦 Attenuation http://commons.wikimedia.org Computing Absorption and Out-Scattering 06.12.2018 CG - Volume Rendering - Pascal Grittmann, Jaroslav Křivánek 19
Attenuation = Absorption + Out-Scattering • Every point in the volume might absorb light or scatter it in other directions (both in [m −1 ]) • Modeled by absorption and scattering coefficients: 𝜈 𝑏 𝑨 and 𝜈 𝑡 𝑨 • Might depend on position, direction, time, wavelength, … • For simplicity: we assume only positional dependence 𝑐 𝑏 𝑦 𝑨 06.12.2018 CG - Volume Rendering - Pascal Grittmann, Jaroslav Křivánek 20
Computing Absorption – Intuition • Consider a small segment Δ𝑨 • Along that segment, radiance is reduced from 𝑀 to 𝑀 ′ • 𝑀 ′ = 𝑀 − 𝑀(𝜈 𝑏 Δ𝑨) • Where 𝜈 𝑏 is the percentage of radiance that is absorbed (per unit distance) 𝑀 𝑀 ′ 𝑐 𝑏 Δ𝑨 06.12.2018 CG - Volume Rendering - Pascal Grittmann, Jaroslav Křivánek 21
Computing Absorption – Intuition • Consider a small segment Δ𝑨 • Along that segment, radiance is reduced from 𝑀 to 𝑀 ′ • 𝑀 ′ = 𝑀 − 𝑀(𝜈 𝑏 Δ𝑨) • Where 𝜈 𝑏 is the percentage of radiance that is absorbed (per unit distance) • Lets rewrite this: • Δ𝑀 = 𝑀 ′ − 𝑀 = −𝑀𝜈 𝑏 Δ𝑨 𝑀 𝑀 ′ 𝑐 𝑏 Δ𝑨 06.12.2018 CG - Volume Rendering - Pascal Grittmann, Jaroslav Křivánek 22
Computing Absorption – Exponential Decay • Δ𝑀 = −𝜈 𝑏 𝑀 Δ𝑨 • For infinitely small Δ𝑨 , this becomes • 𝑒𝑀 = −𝜈 𝑏 𝑀 𝑒𝑨 • A differential equation that models exponential decay! 𝑨 𝜈 𝑏 𝑢 𝑒𝑢 • Solution: 𝑀 𝑏 = 𝑀 𝑝 𝑦 𝑓 − 0 𝑀 𝑐 = 𝑀 𝑝 𝑦 𝑀 𝑏 𝑀 𝑀 ′ 𝑐 𝑏 Δ𝑨 𝑦 06.12.2018 CG - Volume Rendering - Pascal Grittmann, Jaroslav Křivánek 23
Computing Out-Scattering • Same as absorption, only different factor! 𝑨 𝜈 𝑡 𝑢 𝑒𝑢 • 𝑀 𝑏 = 𝑀 𝑝 𝑦 𝑓 − 0 𝑐 𝑏 𝑦 𝑨 06.12.2018 CG - Volume Rendering - Pascal Grittmann, Jaroslav Křivánek 24
Computing Attenuation • Fraction of light that is either absorbed or out-scattered (per unit distance) • 𝜈 𝑢 = 𝜈 𝑏 + 𝜈 𝑡 • Many different names: extinction / attenuation / transport coefficient 𝑨 (𝜈 𝑏 𝑢 +𝜈 𝑡 𝑢 ) 𝑒𝑢 • 𝑀 𝑏 = 𝑀 𝑝 𝑦 𝑓 − 0 𝑏 𝜈 𝑢 𝑢 𝑒𝑢 • Attenuation: 𝑈 𝑏, 𝑐 = 𝑓 − 𝑐 𝑐 𝑏 𝑦 𝑨 06.12.2018 CG - Volume Rendering - Pascal Grittmann, Jaroslav Křivánek 25
Estimating Attenuation • We need to evaluate another integral: 𝑏 𝜈 𝑢 𝑢 𝑒𝑢 • 𝑈 𝑏, 𝑐 = 𝑓 − 𝑐 • Many approaches, e.g., Monte Carlo integration or deterministic quadrature 06.12.2018 CG - Volume Rendering - Pascal Grittmann, Jaroslav Křivánek 26
Estimating Attenuation – Ray Marching • We need to evaluate another integral: 𝑏 𝜈 𝑢 𝑢 𝑒𝑢 • 𝑈 𝑏, 𝑐 = 𝑓 − 𝑐 • Many approaches, e.g., Monte Carlo integration or deterministic quadrature • Ray marching: evaluate at discrete positions (fixed stepsize Δ𝑨 ) 𝑏 𝜈 𝑢 𝑢 𝑒𝑢 ≈ σ 𝑗 𝜈 𝑢 (𝑨 𝑗 + 𝜁) Δ𝑨 • 𝑐 • Randomized offset 𝜻 for each ray to avoid aliasing problems Δ𝑨 Δ𝑨 Δ𝑨 Δ𝑨 𝑐 𝑏 𝑦 𝑨 1 𝑨 2 𝑨 3 06.12.2018 CG - Volume Rendering - Pascal Grittmann, Jaroslav Křivánek 27
𝑏 𝑐 𝑨 Emission Explosions! http://wikipedia.org 06.12.2018 CG - Volume Rendering - Pascal Grittmann, Jaroslav Křivánek 28
Every Point Might Emit Light • Assume 𝑨 emits 𝑀 𝑓 𝑨 towards 𝑏 • Some of that light might be absorbed or out-scattered: It is attenuated • 𝑀 𝑏 = 𝑀 𝑓 𝑨 𝑈 𝑨, 𝑏 𝑐 𝑏 𝑨 06.12.2018 CG - Volume Rendering - Pascal Grittmann, Jaroslav Křivánek 29
Every Point Might Emit Light • Assume 𝑨 emits 𝑀 𝑓 𝑨 towards 𝑏 • Some of that light might be absorbed or out-scattered: It is attenuated • 𝑀 𝑏 = 𝑀 𝑓 𝑨 𝑈 𝑨, 𝑏 • Happens at every point along the ray! 𝑐 𝑀 𝑓 𝑨 𝑈 𝑨, 𝑏 𝑒𝑨 • 𝑀 𝑏 = 𝑏 • Another integral … 𝑐 𝑏 𝑨 06.12.2018 CG - Volume Rendering - Pascal Grittmann, Jaroslav Křivánek 30
Ray Marching for Emission • Same as before: integrate via quadrature 𝑐 𝑀 𝑓 𝑨 𝑈 𝑨, 𝑏 𝑒𝑨 ≈ σ 𝑗 𝑀 𝑓 𝑨 𝑗 𝑈 𝑨 𝑗 , 𝑏 Δ𝑨 • 𝑏 • Attenuation 𝑈 𝑨 𝑗 , 𝑏 estimated as before Δ𝑨 Δ𝑨 Δ𝑨 Δ𝑨 𝑐 𝑏 𝑦 𝑨 1 𝑨 2 𝑨 3 06.12.2018 CG - Volume Rendering - Pascal Grittmann, Jaroslav Křivánek 31
Ray Marching for Emission • Same as before: integrate via quadrature 𝑐 𝑀 𝑓 𝑨 𝑈 𝑨, 𝑏 𝑒𝑨 ≈ σ 𝑗 𝑀 𝑓 𝑨 𝑗 𝑈 𝑨 𝑗 , 𝑏 Δ𝑨 • 𝑏 • Attenuation 𝑈 𝑨 𝑗 , 𝑏 estimated as before • Attenuation can be incrementally updated: • 𝑈 𝑨 𝑗 , 𝑏 = 𝑈 𝑨 𝑗−1 , 𝑏 𝑈 𝑨 𝑗 , 𝑨 𝑗−1 • (because it is an exponential function) Δ𝑨 Δ𝑨 Δ𝑨 Δ𝑨 𝑐 𝑏 𝑦 𝑨 1 𝑨 2 𝑨 3 06.12.2018 CG - Volume Rendering - Pascal Grittmann, Jaroslav Křivánek 32
𝑐 𝑏 𝑨 In-Scattering Accounting for “Reflections” Inside the Volume 06.12.2018 CG - Volume Rendering - Pascal Grittmann, Jaroslav Křivánek 33
Recommend
More recommend