- Volume Rendering - Pascal Grittmann, Jaroslav K ivnek Using - - PowerPoint PPT Presentation

volume rendering
SMART_READER_LITE
LIVE PREVIEW

- Volume Rendering - Pascal Grittmann, Jaroslav K ivnek Using - - PowerPoint PPT Presentation

Computer Graphics - Volume Rendering - Pascal Grittmann, Jaroslav K ivnek 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, 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

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, Jaroslav Křivánek 2

slide-3
SLIDE 3

06.12.2018 3

slide-4
SLIDE 4

06.12.2018 4

slide-5
SLIDE 5

06.12.2018 5

slide-6
SLIDE 6

06.12.2018 6

slide-7
SLIDE 7

06.12.2018 7

slide-8
SLIDE 8

Fundamentals

06.12.2018 CG - Volume Rendering - Pascal Grittmann, Jaroslav Křivánek 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, Jaroslav Křivánek 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, Jaroslav Křivánek 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, Jaroslav Křivánek 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, Jaroslav Křivánek 12

http://wikipedia.org

slide-13
SLIDE 13

Data Acquisition

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

06.12.2018 CG - Volume Rendering - Pascal Grittmann, Jaroslav Křivánek 13

https://docs.blender.org

slide-14
SLIDE 14

Simulating Volumes

Mathematical Formulation of Volumetric Light Transport

06.12.2018 CG - Volume Rendering - Pascal Grittmann, Jaroslav Křivánek 14

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

So far: Assume Vacuum

06.12.2018 CG - Volume Rendering - Pascal Grittmann, Jaroslav Křivánek 15

𝑦

slide-16
SLIDE 16
  • 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, Jaroslav Křivánek 16

𝑦 𝑏 𝑐

slide-17
SLIDE 17
  • 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, Jaroslav Křivánek 17

𝑦 𝑏 𝑐 𝑨

slide-18
SLIDE 18
  • 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, Jaroslav Křivánek 18

𝑦 𝑏 𝑐 𝑨

slide-19
SLIDE 19

Attenuation

Computing Absorption and Out-Scattering

06.12.2018 CG - Volume Rendering - Pascal Grittmann, Jaroslav Křivánek 19

𝑦 𝑏 𝑐 𝑀𝑗 = ? 𝑀0 𝑦

http://commons.wikimedia.org

slide-20
SLIDE 20

Attenuation = Absorption + Out-Scattering

  • Every point in the volume might absorb light or scatter it in other directions
  • Modeled by absorption and scattering coefficients: 𝜈𝑏 𝑨 and 𝜈𝑡 𝑨

(both in [m−1])

  • 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

𝑦 𝑏 𝑐 𝑨

slide-21
SLIDE 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)

06.12.2018 CG - Volume Rendering - Pascal Grittmann, Jaroslav Křivánek 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)
  • Lets rewrite this:
  • Δ𝑀 = 𝑀′ − 𝑀 = −𝑀𝜈𝑏Δ𝑨

06.12.2018 CG - Volume Rendering - Pascal Grittmann, Jaroslav Křivánek 22

𝑏 𝑐 Δ𝑨 𝑀 𝑀′

slide-23
SLIDE 23

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, Jaroslav Křivánek 23

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

slide-24
SLIDE 24

Computing Out-Scattering

  • Same as absorption, only different factor!
  • 𝑀 𝑏 = 𝑀𝑝 𝑦 𝑓− ׬

𝑨 𝜈𝑡 𝑢 𝑒𝑢 06.12.2018 CG - Volume Rendering - Pascal Grittmann, Jaroslav Křivánek 24

𝑦 𝑏 𝑐 𝑨

slide-25
SLIDE 25

Computing Attenuation

  • Fraction of light that is either absorbed or out-scattered (per unit distance)
  • 𝜈𝑢 = 𝜈𝑏 + 𝜈𝑡
  • Many different names: extinction / attenuation / transport coefficient
  • 𝑀 𝑏 = 𝑀𝑝 𝑦 𝑓− ׬

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

  • Attenuation: 𝑈 𝑏, 𝑐 = 𝑓− ׬

𝑐 𝑏 𝜈𝑢 𝑢 𝑒𝑢 06.12.2018 CG - Volume Rendering - Pascal Grittmann, Jaroslav Křivánek 25

𝑦 𝑏 𝑐 𝑨

slide-26
SLIDE 26

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

slide-27
SLIDE 27

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

06.12.2018 CG - Volume Rendering - Pascal Grittmann, Jaroslav Křivánek 27

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

slide-28
SLIDE 28

Emission

Explosions!

06.12.2018 CG - Volume Rendering - Pascal Grittmann, Jaroslav Křivánek 28

𝑏 𝑐 𝑨

http://wikipedia.org

slide-29
SLIDE 29

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

𝑏 𝑐 𝑨

slide-30
SLIDE 30

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

𝑏 𝑐 𝑨

slide-31
SLIDE 31

Ray Marching for Emission

  • Same as before: integrate via quadrature
  • ׬

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

  • Attenuation 𝑈 𝑨𝑗, 𝑏 estimated as before

06.12.2018 CG - Volume Rendering - Pascal Grittmann, Jaroslav Křivánek 31

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

slide-32
SLIDE 32

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, Jaroslav Křivánek 32

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

slide-33
SLIDE 33

In-Scattering

Accounting for “Reflections” Inside the Volume

06.12.2018 CG - Volume Rendering - Pascal Grittmann, Jaroslav Křivánek 33

𝑏 𝑐 𝑨

slide-34
SLIDE 34

Direct Illumination (Single-scattering)

  • 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, Jaroslav Křivánek 34

𝑏 𝑐 𝑨 𝜕𝑗 𝜕𝑝

slide-35
SLIDE 35

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, Jaroslav Křivánek 35

slide-36
SLIDE 36

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 angle between the directions

06.12.2018 CG - Volume Rendering - Pascal Grittmann, Jaroslav Křivánek 36

slide-37
SLIDE 37

Henyey-Greenstein: Asymmetry Parameter

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

06.12.2018 CG - Volume Rendering - Pascal Grittmann, Jaroslav Křivánek 37

http://coclouds.com

Forward Scattering

http://commons.wikimedia.org

Back Scattering

slide-38
SLIDE 38

How to Estimate Volumetric 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, Jaroslav Křivánek 38

𝑏 𝑐 𝑨 𝜕𝑗 𝜕𝑝

slide-39
SLIDE 39

Ray Marching to Compute In-Scattering

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

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

  • Quadrature:
  • ׬

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

06.12.2018 CG - Volume Rendering - Pascal Grittmann, Jaroslav Křivánek 39

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

slide-40
SLIDE 40

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, Jaroslav Křivánek 40

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

slide-41
SLIDE 41

Putting it all Together

A Simple Volume Integrator

06.12.2018 CG - Volume Rendering - Pascal Grittmann, Jaroslav Křivánek 41

slide-42
SLIDE 42

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, Jaroslav Křivánek 42

slide-43
SLIDE 43

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, Jaroslav Křivánek 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)
  • 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, Jaroslav Křivánek 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, 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, Jaroslav Křivánek 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
  • 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, Jaroslav Křivánek 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)
  • Add together:
  • Attenuated illumination from z
  • Volumetric emission along 𝑦𝑧
  • In-scattering along 𝑦𝑧
  • Direct illumination at 𝑦

𝑦 𝑧 𝑨

06.12.2018 CG - Volume Rendering - Pascal Grittmann, Jaroslav Křivánek 47