13
Page 1 CS348B Lecture 13 Pat Hanrahan, Spring 2001 Participating Media and Volumetric Scattering Applications ! Clouds, smoke, water, … ! Subsurface scattering: paint, skin, … ! Scientific and medical visualization: CT, MRI, … Topics ! Absorption ! Scattering and phase functions ! Volume rendering equation ! Volume representations ! Ray tracing volumes CS348B Lecture 13 Pat Hanrahan, Spring 2001 Absorption Beer’s Law L dL + (, ) Lx ω ds () a x σ (, ) ()(, ) a dL x xLx ds ω σ ω =− () ( , ) (, ) (, ) a s s Lx s Lx e Lx e σ τ ωω ω ω + = = () ( , ) () (, ) (, ) s Lx s TsLx e Lx τ ωω ω ω + = = Absorption cross-section : probability of being absorbed per unit length Homogenous media: constant a σ Inhomogenous media: varying ( ) a x σ 0 () ( ) s a s x s ds τ σ ω = + Optical distance or depth 1 2 ( , ) 1 2 () ( , ) x x Ts Tx x e τ = = Transmittance

Participating Media and Volumetric Scatteringgraphics.stanford.edu/courses/cs348b-01/lectures/lecture13/volume.… · halos and glories Source: Minneart, Color and light in the open

  • Upload
    others

  • View
    0

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Participating Media and Volumetric Scatteringgraphics.stanford.edu/courses/cs348b-01/lectures/lecture13/volume.… · halos and glories Source: Minneart, Color and light in the open

Page 1

CS348B Lecture 13 Pat Hanrahan, Spring 2001

Participating Media and Volumetric Scattering

Applications

! Clouds, smoke, water, …

! Subsurface scattering: paint, skin, …

! Scientific and medical visualization: CT, MRI, …

Topics

! Absorption

! Scattering and phase functions

! Volume rendering equation

! Volume representations

! Ray tracing volumes

CS348B Lecture 13 Pat Hanrahan, Spring 2001

Absorption

Beer’s Law

L dL+( , )L x ω

ds

( )a xσ

( , ) ( ) ( , )adL x x L x dsω σ ω= −

( )( , ) ( , ) ( , ) assL x s L x e L x e στω ω ω ω −−+ = =

( )( , ) ( ) ( , ) ( , )sL x s T s L x e L xτω ω ω ω−+ = =

Absorption cross-section : probability of being absorbed per unit length

Homogenous media: constant aσ

Inhomogenous media: varying ( )a xσ0

( ) ( )s

as x s dsτ σ ω′ ′= +∫Optical distance or depth

1 2( , )1 2( ) ( , ) x xT s T x x e τ−= =

Transmittance

Page 2: Participating Media and Volumetric Scatteringgraphics.stanford.edu/courses/cs348b-01/lectures/lecture13/volume.… · halos and glories Source: Minneart, Color and light in the open

Page 2

CS348B Lecture 13 Pat Hanrahan, Spring 2001

Out-Scatter

L dL+( , )L x ω

ds

( )s xσ

( , ) ( ) ( , )sdL x x L x dsω σ ω= −

0

( ) ( )s

ss x s dsτ σ ω′ ′= +∫

Scattering cross-section

t a sσ σ σ= +Total cross-section

Attenuation due to both absorption andscattering: extinction coefficient

s s

t a s

Wσ σσ σ σ

= =+

Albedo

CS348B Lecture 13 Pat Hanrahan, Spring 2001

Black Clouds

Source: Greenler, Rainbows, halos and glories

Page 3: Participating Media and Volumetric Scatteringgraphics.stanford.edu/courses/cs348b-01/lectures/lecture13/volume.… · halos and glories Source: Minneart, Color and light in the open

Page 3

CS348B Lecture 13 Pat Hanrahan, Spring 2001

In-Scatter

2

( , ) ( ) ( , ) ( , )s

S

S x x p x L x dω σ ω ω ω ω′ ′ ′= →∫

L dL+( , )L x ω

ds

( )s xσ

( )p ω ω′ →

2

( ) 1S

p dω ω ω′ ′→ =∫

Scattering or Phase function

CS348B Lecture 13 Pat Hanrahan, Spring 2001

Scattering Equation

2

( , ) ( ) ( , ) ( ) ( , ) ( , )

( ) ( , ) ( ) ( , )

t s

S

t s

dL x ds x L x x p x L x d

x L x x S x

ω ω σ ω σ ω ω ω ω

σ ω σ ω

′ ′ ′+ = − + →

= − +

L dL+( , )L x ω

ds

( )s xσ

Page 4: Participating Media and Volumetric Scatteringgraphics.stanford.edu/courses/cs348b-01/lectures/lecture13/volume.… · halos and glories Source: Minneart, Color and light in the open

Page 4

CS348B Lecture 13 Pat Hanrahan, Spring 2001

The Volume Rendering Equation

Integro-differential equation

Integro-integral equation

Attenuation: Absorption and scattering Source: Scatter (+ emission)

( , )( ) ( , ) ( ) ( , )t s

L xx L x x S x

s

ω σ ω σ ω∂ = − +∂

[ ]0

( )

0

( , ) ( ) ( )

s

t x s ds

sL x e x s S x s dsσ ω

ω σ ω ω

∞ ′′ ′′− +∫′ ′ ′= + +∫

CS348B Lecture 13 Pat Hanrahan, Spring 2001

Simple Atmosphere Model

Assumptions

! Homogenous media

! Constant source term (airlight)

Fog

Haze

( )( )t

L sL s S

sσ∂ = − +

( )( ) 1 t ts sL s e S e Cσ σ− −= − +

Page 5: Participating Media and Volumetric Scatteringgraphics.stanford.edu/courses/cs348b-01/lectures/lecture13/volume.… · halos and glories Source: Minneart, Color and light in the open

Page 5

CS348B Lecture 13 Pat Hanrahan, Spring 2001

The Sky

Source: Greenler, Rainbows, halos and glories

CS348B Lecture 13 Pat Hanrahan, Spring 2001

Atmospheric Perspective

Source: Greenler, Rainbows, halos and glories

Page 6: Participating Media and Volumetric Scatteringgraphics.stanford.edu/courses/cs348b-01/lectures/lecture13/volume.… · halos and glories Source: Minneart, Color and light in the open

Page 6

CS348B Lecture 13 Pat Hanrahan, Spring 2001

Atmospheric Perspective

Aerial Perspective: loss of contrast and change in color

Source: Musgrave

CS348B Lecture 13 Pat Hanrahan, Spring 2001

Semi-Infinite Homogenous Planar Media

Reduced Intensity

Total first order scattering

( , )( , ) ( , )o

t o s o

L zL z S z

z

ω σ ω σ ω∂ = − +∂

( , )( , ) (0, )izi iL z e Lτ ωω ω−= / cost izτ σ θ=

( , )( , ) ( ) (0, )cosizo i o i iS z p e Lτ ωω ω ω ω θ−= →

/ cos / cos

0

( ) ( , ) ( )

cos( , ) ( )

cos cos

t i t oz zo s i o i

ii o i

i o

L p L e e dz

Wp L

σ θ σ θω σ ω ω ω

θω ω ωθ θ

∞− −=

=+

∫Seeliger’s LawLaw of Diffuse Reflection

Page 7: Participating Media and Volumetric Scatteringgraphics.stanford.edu/courses/cs348b-01/lectures/lecture13/volume.… · halos and glories Source: Minneart, Color and light in the open

Page 7

CS348B Lecture 13 Pat Hanrahan, Spring 2001

Subsurface Scattering

Skin

CS348B Lecture 13 Pat Hanrahan, Spring 2001

Translucent Materials

Surface Reflection Subsurface Reflection

Page 8: Participating Media and Volumetric Scatteringgraphics.stanford.edu/courses/cs348b-01/lectures/lecture13/volume.… · halos and glories Source: Minneart, Color and light in the open

Page 8

CS348B Lecture 13 Pat Hanrahan, Spring 2001

Phase Functions

Phase angle

Phase functions

(from the phase of the moon)

1. Isotropic

-simple

2. Rayleigh

-molecules

3. Mie scattering

- small spheres

... Huge literature ...

cosθ ω ω′= •

θ

ω′

ω

1(cos )

4p θ

π=

2

4

3 1 cos(cos )

4p

θθλ

+=

CS348B Lecture 13 Pat Hanrahan, Spring 2001

Blue Sky = Red Sunset

Source: Greenler, Rainbows, halos and glories

Page 9: Participating Media and Volumetric Scatteringgraphics.stanford.edu/courses/cs348b-01/lectures/lecture13/volume.… · halos and glories Source: Minneart, Color and light in the open

Page 9

CS348B Lecture 13 Pat Hanrahan, Spring 2001

Coronas and Halos

Moon Corona Sun Halos

Source: Greenler, Rainbows, halos and glories

CS348B Lecture 13 Pat Hanrahan, Spring 2001

Henyey-Greenstein Phase Function

( )2

32 2

1 1(cos )

4 1 2 cos

gp

g gθ

π θ

−=+ −

0

2 (cos )cosp d gπ

π θ θ θ=∫

Empirical phase function

g: average phase angle

g = -0.3

g = 0.6

Page 10: Participating Media and Volumetric Scatteringgraphics.stanford.edu/courses/cs348b-01/lectures/lecture13/volume.… · halos and glories Source: Minneart, Color and light in the open

Page 10

CS348B Lecture 13 Pat Hanrahan, Spring 2001

Volume Representations

3D arrays (uniform rectangular)

! CT data

3D meshes

! CFD, mechanical simulation

Simple shapes with solid texture

! Ellipsoidal clouds with sum-of-sines densities

! Hypertexture

CS348B Lecture 13 Pat Hanrahan, Spring 2001

Ray Marching

Primary ray

Direct Lighting

Page 11: Participating Media and Volumetric Scatteringgraphics.stanford.edu/courses/cs348b-01/lectures/lecture13/volume.… · halos and glories Source: Minneart, Color and light in the open

Page 11

CS348B Lecture 13 Pat Hanrahan, Spring 2001

Ray Marching with Shadows

Primary ray

Shadow rays

CS348B Lecture 13 Pat Hanrahan, Spring 2001

Ray Marching

( , , ), ( , , )s ai j k i j kσ σ

1ls −

ls

1ls +

( ) trilinear( , , , , ( ))l ls i j k x sσ σ=1 1

1

( ) ( ( )) ( , ( ( ))) ( ( ), ( ( ))

( ) ( ) ( ) ( )

( ) ( ) (1 ( ( )) )

l t l l s l l

l l l l

l l t l

S s x s p x s L x s x s s

L s L s T s S s

T s T s x s s

σ ω ω ω

σ− −

′ ′= ∆= += − ∆

Voxel

Page 12: Participating Media and Volumetric Scatteringgraphics.stanford.edu/courses/cs348b-01/lectures/lecture13/volume.… · halos and glories Source: Minneart, Color and light in the open

Page 12

CS348B Lecture 13 Pat Hanrahan, Spring 2001

Beams of Light

Source: Greenler, Rainbows,halos and glories

Source: Minneart, Color and lightin the open air

CS348B Lecture 13 Pat Hanrahan, Spring 2001

Clouds and Atmospheric Phenomena

7am

9am

6:30pm

Hogum MountainSunrise and sunset

Modeling:Simon PremozeWilliam Thompson

Rendering:Henrik Wann Jensen

Page 13: Participating Media and Volumetric Scatteringgraphics.stanford.edu/courses/cs348b-01/lectures/lecture13/volume.… · halos and glories Source: Minneart, Color and light in the open

Page 13

CS348B Lecture 13 Pat Hanrahan, Spring 2001

Ray Marching – Color and Opacity

M. Levoy, Ray tracing volume densities

( , , ) ( , , )

( , , )

C i j k R G B

A i j k

1ls −

ls

1ls +

( ( )) trilinear( , , , , ( ))l lc x s c i j k x s=

1 1(1 ) ( ( ))l l l lC C A c x s− −= + −

Voxel

Note: Must use premultiplied colors

( )( , , ) ( , , ) * ( , , ), ( , , )c i j k C i j k A i j k A i j k=

Note: 4-component over

CS348B Lecture 13 Pat Hanrahan, Spring 2001

Examples

Participating media

! Texels

! Hypertextures

Visualization

! Visible human

! Finite element

Multiple Scattering

! Translucent materials

! Clouds and smoke

! Rendering equation