- Volume Rendering - Pascal Grittmann Philipp Slusallek Using - - PowerPoint PPT Presentation

volume rendering
SMART_READER_LITE
LIVE PREVIEW

- Volume Rendering - Pascal Grittmann Philipp Slusallek Using - - PowerPoint PPT Presentation

Computer Graphics - Volume Rendering - Pascal Grittmann Philipp Slusallek Using pictures from: Monte Carlo Methods for Physically Based Volume Rendering ; SIGGRAPH 2018 Course; Jan Novk, Iliyan Georgiev, Johannes Hanika, Jaroslav Kivnek ,


slide-1
SLIDE 1

Computer Graphics

  • Volume Rendering -

Pascal Grittmann Philipp Slusallek

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

slide-2
SLIDE 2

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 2

slide-3
SLIDE 3
slide-4
SLIDE 4
slide-5
SLIDE 5
slide-6
SLIDE 6
slide-7
SLIDE 7
slide-8
SLIDE 8

Fundamentals

06.12.2018 CG - Volume Rendering - Pascal Grittmann 8

slide-9
SLIDE 9

Volumetric Effects

  • Light interacts not only with surfaces but everywhere inside!
  • Volumes scatter, emit, or absorb light

06.12.2018 CG - Volume Rendering - Pascal Grittmann 9

http://coclouds.com http://wikipedia.org http://commons.wikimedia.org

slide-10
SLIDE 10

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 10

slide-11
SLIDE 11

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 11

slide-12
SLIDE 12

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)

06.12.2018 CG - Volume Rendering - Pascal Grittmann 12

http://wikipedia.org

slide-13
SLIDE 13

Representation Example: OpenVDB

  • Open source library
  • Manages volume data
  • Discretized, sparse, hierarchical grid

06.12.2018 CG - Volume Rendering - Pascal Grittmann 13

[K. Museth, 2013]

slide-14
SLIDE 14

Data Acquisition Examples

  • Real-world measurements via tomography
  • Simulation, e.g.,
  • Fluids,
  • Fire and smoke,
  • Fog

06.12.2018 CG - Volume Rendering - Pascal Grittmann 14

https://docs.blender.org

slide-15
SLIDE 15

Simulating Volumes

Mathematical Formulation of Volumetric Light Transport

06.12.2018 CG - Volume Rendering - Pascal Grittmann 15

slide-16
SLIDE 16
  • Compute 𝑀𝑝(𝑦, 𝜕𝑝) using the rendering equation

So far: Assume Vacuum

06.12.2018 CG - Volume Rendering - Pascal Grittmann 16

𝑦

slide-17
SLIDE 17
  • Compute 𝑀𝑝(𝑦, 𝜕𝑝) using the rendering equation
  • Only a fraction 𝑈 𝑏, 𝑐 𝑀𝑝 𝑦, 𝜕𝑝 arrives at the eye

Volume Absorbs and Scatters Light

06.12.2018 CG - Volume Rendering - Pascal Grittmann 17

𝑦 𝑏 𝑐

slide-18
SLIDE 18
  • Compute 𝑀𝑝(𝑦, 𝜕𝑝) using the rendering equation
  • Only a fraction 𝑈 𝑏, 𝑐 𝑀𝑝 𝑦, 𝜕𝑝 arrives at the eye
  • Every point 𝑨 between 𝑏 and 𝑐 might emit light

Volume Emits Light

06.12.2018 CG - Volume Rendering - Pascal Grittmann 18

𝑦 𝑏 𝑐 𝑨

slide-19
SLIDE 19
  • 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

Volume Scatters Light

06.12.2018 CG - Volume Rendering - Pascal Grittmann 19

𝑦 𝑏 𝑐 𝑨

slide-20
SLIDE 20

Attenuation

Computing Absorption and Out-Scattering

06.12.2018 CG - Volume Rendering - Pascal Grittmann 20

𝑦 𝑏 𝑐 𝑀𝑗 = ? 𝑀0 𝑦

http://commons.wikimedia.org

slide-21
SLIDE 21

Attenuation = Absorption + Out-Scattering

  • Every point in the volume might absorb light or scatter it in other

directions

  • Modeled by absorption and scattering densities: 𝜈𝑏 𝑨 and 𝜈𝑡 𝑨
  • Might depend on position, direction, time, wavelength,…
  • For simplicity: we assume only positional dependence

06.12.2018 CG - Volume Rendering - Pascal Grittmann 21

𝑦 𝑏 𝑐 𝑨

slide-22
SLIDE 22

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 22

𝑏 𝑐 Δ𝑨 𝑀 𝑀′

slide-23
SLIDE 23

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 23

𝑏 𝑐 Δ𝑨 𝑀 𝑀′

So the absorbed radiance is: Δ𝑀 = 𝑀′ − 𝑀 = −𝜈𝑏 𝑀 Δ𝑨

slide-24
SLIDE 24

Computing Absorption – Exponential Decay

  • Δ𝑀 = −𝜈𝑏 𝑀 Δ𝑨
  • For infinitely small Δ𝑨, this becomes
  • 𝑒𝑀 = −𝜈𝑏 𝑀 𝑒𝑨
  • A differential equation that models exponential decay!
  • Solution: 𝑀 𝑏 = 𝑀𝑝 𝑦 𝑓− ׬

𝑐 𝑏 𝜈𝑏 𝑢 𝑒𝑢

06.12.2018 CG - Volume Rendering - Pascal Grittmann 24

𝑦 𝑀 𝑐 = 𝑀𝑝 𝑦 𝑀 𝑏 𝑏 𝑐 Δ𝑨 𝑀 𝑀′

slide-25
SLIDE 25

Computing Out-Scattering

  • Same as absorption, only different factor!
  • 𝜈𝑡 𝑨 : percentage of light scattered at point 𝑨
  • 𝑀 𝑏 = 𝑀𝑝 𝑦 𝑓− ׬

𝑐 𝑏 𝜈𝑡 𝑢 𝑒𝑢

06.12.2018 CG - Volume Rendering - Pascal Grittmann 25

𝑦 𝑏 𝑐 𝑨

slide-26
SLIDE 26

Computing Attenuation

  • Fraction of light that is neither absorbed nor out-scattered
  • 𝜈𝑢 = 𝜈𝑏 + 𝜈𝑡
  • 𝑀 𝑏 = 𝑀𝑝 𝑦 𝑓− ׬

𝑐 𝑏(𝜈𝑏 𝑢 +𝜈𝑡 𝑢 ) 𝑒𝑢

  • Attenuation: 𝑈 𝑏, 𝑐 = 𝑓− ׬

𝑐 𝑏 𝜈𝑢 𝑢 𝑒𝑢

06.12.2018 CG - Volume Rendering - Pascal Grittmann 26

𝑦 𝑏 𝑐 𝑨

slide-27
SLIDE 27

Computing Attenuation – Homogeneous

  • Simple case: constant density / attenuation
  • 𝜈𝑢 𝑨 = 𝜈𝑢

∀𝑨

  • 𝑈 𝑏, 𝑐 = 𝑓− ׬

𝑐 𝑏 𝜈𝑢 𝑢 𝑒𝑢 = 𝑓−(𝑏−𝑐)𝜈𝑢

06.12.2018 CG - Volume Rendering - Pascal Grittmann 27

𝑦 𝑏 𝑐 𝑨

slide-28
SLIDE 28

Estimating Attenuation

  • We need to solve another integral:
  • 𝑈 𝑏, 𝑐 = 𝑓− ׬

𝑐 𝑏 𝜈𝑢 𝑢 𝑒𝑢

  • Many solutions, e.g., Monte Carlo integration (next semester)
  • Simple solution: Quadrature

06.12.2018 CG - Volume Rendering - Pascal Grittmann 28

slide-29
SLIDE 29

Estimating Attenuation – Ray Marching

  • We need to solve another integral:
  • 𝑈 𝑏, 𝑐 = 𝑓− ׬

𝑐 𝑏 𝜈𝑢 𝑢 𝑒𝑢

  • Simple solution: Quadrature
  • Ray marching: evaluate at discrete positions (fixed stepsize Δ𝑨)
  • ׬

𝑐 𝑏 𝜈𝑢 𝑢 𝑒𝑢 ≈ σ𝑗 𝜈𝑢(𝑨𝑗) Δ𝑨

06.12.2018 CG - Volume Rendering - Pascal Grittmann 29

𝑦 𝑏 𝑐 𝑨1 𝑨2 𝑨3 Δ𝑨 Δ𝑨 Δ𝑨 Δ𝑨

slide-30
SLIDE 30

Emission

Explosions!

06.12.2018 CG - Volume Rendering - Pascal Grittmann 30

𝑏 𝑐 𝑨

http://wikipedia.org

slide-31
SLIDE 31

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 31

𝑏 𝑐 𝑨

slide-32
SLIDE 32

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 32

𝑏 𝑐 𝑨

slide-33
SLIDE 33

Ray Marching for Emission

  • Same as before: integrate via quadrature
  • ׬

𝑏 𝑐 𝑀𝑓 𝑨 𝑈 𝑨, 𝑏 𝑒𝑨 ≈ σ𝑗 𝑀𝑓 𝑨𝑗 𝑈 𝑨𝑗, 𝑏 Δ𝑨

  • Attenuation 𝑈 𝑨𝑗, 𝑏 estimated as before

06.12.2018 CG - Volume Rendering - Pascal Grittmann 33

𝑦 𝑏 𝑐 𝑨1 𝑨2 𝑨3 Δ𝑨 Δ𝑨 Δ𝑨 Δ𝑨

slide-34
SLIDE 34

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)

06.12.2018 CG - Volume Rendering - Pascal Grittmann 34

𝑦 𝑏 𝑐 𝑨1 𝑨2 𝑨3 Δ𝑨 Δ𝑨 Δ𝑨 Δ𝑨

slide-35
SLIDE 35

In-Scattering

Accounting for Reflections Inside the Volume

06.12.2018 CG - Volume Rendering - Pascal Grittmann 35

𝑏 𝑐 𝑨

slide-36
SLIDE 36

Direct Illumination

  • Account for the (attenuated) direct illumination at every point 𝑨
  • Similar to the rendering equation:
  • 𝑀𝑝 𝑨, 𝜕𝑝 = ׬

Ω 𝑀𝑗 𝑦, 𝜕𝑗 𝑔 𝑞 𝜕𝑗, 𝜕𝑝 𝑒𝜕𝑗

  • Integration over the whole sphere Ω
  • The phase function 𝑔

𝑞 takes on the role of the BSDF

06.12.2018 CG - Volume Rendering - Pascal Grittmann 36

𝑏 𝑐 𝑨 𝜕𝑗 𝜕𝑝

slide-37
SLIDE 37

Phase Functions

  • 𝑀𝑝 𝑨, 𝜕𝑝 = ׬

Ω 𝑀𝑗 𝑦, 𝜕𝑗 𝒈𝒒 𝝏𝒋, 𝝏𝒑 𝑒𝜕𝑗

  • Describe what fraction of light is reflected from 𝜕𝑗 to 𝜕𝑝
  • Similar to BSDF for surface scattering
  • Simplest example: isotropic phase function
  • 𝑔

𝑞 𝜕𝑗, 𝜕𝑝 = 1 4𝜌

  • (energy conservation: ׬

Ω 1 4𝜌 𝑒𝜕 = 1)

06.12.2018 CG - Volume Rendering - Pascal Grittmann 37

slide-38
SLIDE 38

Phase Functions: Henyey-Greenstein

  • Widely used
  • Easy to fit to measured data
  • 𝑔

𝑞 𝜕𝑗, 𝜕𝑝 = 1 4𝜌 1−𝑕2 1+𝑕2+2𝑕 cos 𝜕𝑗,𝜕𝑝

3 2

  • 𝑕: asymmetry (scalar)
  • cos 𝜕𝑗, 𝜕𝑝 : cosine of the angle formed by 𝜕𝑗 and 𝜕𝑝

06.12.2018 CG - Volume Rendering - Pascal Grittmann 38

slide-39
SLIDE 39

Henyey-Greenstein: Asymmetry Parameter

  • 𝑕 = 0: isotropic
  • Negative 𝑕: back scattering
  • Positive 𝑕: forward scattering

06.12.2018 CG - Volume Rendering - Pascal Grittmann 39

http://coclouds.com

Forward Scattering

http://commons.wikimedia.org

Back Scattering

slide-40
SLIDE 40

How to Estimate Volume Direct Illumination

  • Reflected radiance at a point 𝑨: 𝑀𝑝 𝑨, 𝜕𝑝 =

׬

Ω 𝑀𝑗 𝑦, 𝜕𝑗 𝑔 𝑞 𝜕𝑗, 𝜕𝑝 𝑒𝜕𝑗

  • In our framework:
  • Sum over all point lights (as for surfaces)
  • Trace shadow ray (as for surfaces)
  • Estimate attenuation along the shadow ray (as for surfaces)

06.12.2018 CG - Volume Rendering - Pascal Grittmann 40

𝑏 𝑐 𝑨 𝜕𝑗 𝜕𝑝

slide-41
SLIDE 41

Ray Marching to Compute In-Scattering

  • Same as for emission
  • Goal: estimate the integral ׬

𝑏 𝑐 𝑈 𝑨, 𝑏 𝜈𝑡 𝑨 𝑀𝑗 𝑨 𝑔 𝑞 𝑒𝑨

  • Quadrature:
  • ׬

𝑏 𝑐 𝑈 𝑨, 𝑏 𝜈𝑡 𝑨 𝑀𝑗 𝑨 𝑔 𝑞 𝑒𝑨 ≈ σ𝑗 𝑈 𝑨𝑗, 𝑏 𝜈𝑡 𝑨 𝑀𝑗 𝑨𝑗 𝑔 𝑞 Δ𝑨

06.12.2018 CG - Volume Rendering - Pascal Grittmann 41

𝑏 𝑐 𝑨1 𝑨2 𝑨3 Δ𝑨 Δ𝑨 Δ𝑨 Δ𝑨

slide-42
SLIDE 42

Ray Marching to Compute In-Scattering

  • Same as for emission
  • Goal: estimate the integral ׬

𝑏 𝑐 𝑈 𝑨, 𝑏 𝑀𝑗 𝑨 𝑔 𝑞 𝑒𝑨

  • Quadrature:
  • ׬

𝑏 𝑐 𝑈 𝑨, 𝑏 𝑀𝑗 𝑨 𝑔 𝑞 𝑒𝑨 ≈ σ𝑗 𝑈 𝑨𝑗, 𝑏 𝑀𝑗 𝑨𝑗 𝑔 𝑞 Δ𝑨

  • Attenuation 𝑈 𝑨𝑗, 𝑏 estimated as before
  • Attenuation can be incrementally updated:
  • 𝑈 𝑨𝑗, 𝑏 = 𝑈 𝑨𝑗−1, 𝑏 𝑈 𝑨𝑗, 𝑨𝑗−1
  • (because it is an exponential function)

06.12.2018 CG - Volume Rendering - Pascal Grittmann 42

𝑏 𝑐 𝑨1 𝑨2 𝑨3 Δ𝑨 Δ𝑨 Δ𝑨 Δ𝑨

slide-43
SLIDE 43

Putting it all Together

A Simple Volume Integrator

06.12.2018 CG - Volume Rendering - Pascal Grittmann 43

slide-44
SLIDE 44

A Simple Volume Integrator

  • Estimate direct illumination at x (as before)
  • If volume: continue straight ahead until no volume (yields intersections y, z)

𝑦 𝑧 𝑨

06.12.2018 CG - Volume Rendering - Pascal Grittmann 44

slide-45
SLIDE 45

A Simple Volume Integrator

  • Estimate direct illumination at x (as before)
  • If volume: continue straight ahead until no volume (yields intersections y, z)
  • Ray marching to estimate attenuation, emission,

𝑦 𝑧 𝑨

06.12.2018 CG - Volume Rendering - Pascal Grittmann 45

slide-46
SLIDE 46

A Simple Volume Integrator

  • Estimate direct illumination at x (as before)
  • If volume: continue straight ahead until no volume (yields intersections y, z)
  • Ray marching to estimate attenuation, emission, and in-scattering
  • Shadow rays to the lights + ray marching to compute attenuation

𝑦 𝑧 𝑨

06.12.2018 CG - Volume Rendering - Pascal Grittmann 46

slide-47
SLIDE 47

A Simple Volume Integrator

  • Estimate direct illumination at x (as before)
  • If volume: continue straight ahead until no volume (yields intersections y, z)
  • Ray marching to estimate attenuation, emission, and in-scattering
  • Shadow rays to the lights + ray marching to compute attenuation
  • Compute illumination at z (as before)

𝑦 𝑧 𝑨

06.12.2018 CG - Volume Rendering - Pascal Grittmann 47

slide-48
SLIDE 48

A Simple Volume Integrator

  • Estimate direct illumination at x (as before)
  • If volume: continue straight ahead until no volume (yields intersections y, z)
  • Ray marching to estimate attenuation, emission, and in-scattering
  • Shadow rays to the lights + ray marching to compute attenuation
  • Compute illumination at z (as before)
  • Add together:
  • Attenuated illumination from z
  • Volumetric emission along 𝑦𝑧
  • In-scattering along 𝑦𝑧
  • Direct illumination at 𝑦

𝑦 𝑧 𝑨

06.12.2018 CG - Volume Rendering - Pascal Grittmann 48

slide-49
SLIDE 49

A Simple Volume Integrator

  • Estimate direct illumination at x (as before)
  • If volume: continue straight ahead until no volume (yields intersections y, z)
  • Ray marching to estimate attenuation, emission, and in-scattering
  • Shadow rays to the lights + ray marching to compute attenuation
  • Compute illumination at z (as before)
  • Add together:
  • Attenuated illumination from z
  • Volumetric emission along 𝑦𝑧
  • In-scattering along 𝑦𝑧
  • Direct illumination at 𝑦

𝑦 𝑧 𝑨

{

Multiply by BTDF!

06.12.2018 CG - Volume Rendering - Pascal Grittmann 49

slide-50
SLIDE 50

References

06.12.2018 CG - Volume Rendering - Pascal Grittmann 50

  • [K. Museth, 2013] “VDB: High-Resolution Sparse Volumes With

Dynamic Topology”. ACM Transactions on Graphics, Volume 32, Issue 3, Pages 27:1-27:22, June 2013