cs348b lecture 16pat hanrahan, spring 2005 participating media & vol. scattering applications...

30
CS348B Lecture 16 Pat Hanrahan, Spring 2005 Participating Media & Vol. Scattering Applications Clouds, smoke, water, … Subsurface scattering: paint, skin, … Scientific/medical visualization: CT, MRI, … Topics Absorption and emission Scattering and phase functions Volume rendering equation Homogeneous media Ray tracing volumes

Upload: millicent-walsh

Post on 05-Jan-2016

215 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: CS348B Lecture 16Pat Hanrahan, Spring 2005 Participating Media & Vol. Scattering Applications Clouds, smoke, water, … Subsurface scattering: paint, skin,

CS348B Lecture 16 Pat Hanrahan, Spring 2005

Participating Media & Vol. Scattering

Applications

Clouds, smoke, water, …

Subsurface scattering: paint, skin, …

Scientific/medical visualization: CT, MRI, …

Topics

Absorption and emission

Scattering and phase functions

Volume rendering equation

Homogeneous media

Ray tracing volumes

Page 2: CS348B Lecture 16Pat Hanrahan, Spring 2005 Participating Media & Vol. Scattering Applications Clouds, smoke, water, … Subsurface scattering: paint, skin,

CS348B Lecture 16 Pat Hanrahan, Spring 2005

Absorption

L dL( , )L x

ds

( )a x

( , ) ( ) ( , )adL x x L x ds

Absorption cross-section:

Probability of being absorbed per unit length

( )a x

Page 3: CS348B Lecture 16Pat Hanrahan, Spring 2005 Participating Media & Vol. Scattering Applications Clouds, smoke, water, … Subsurface scattering: paint, skin,

CS348B Lecture 16 Pat Hanrahan, Spring 2005

Transmittance

0

ln ( , ) ( ) ( )s

aL x s x s ds s

0

( ) ( )s

as x s ds

Optical distance or depth

( , )( )

( , ) a

dL xx ds

L x

( , ) ( ) ( , )adL x x L x ds

Homogenous media: constant

( )a as s a

Page 4: CS348B Lecture 16Pat Hanrahan, Spring 2005 Participating Media & Vol. Scattering Applications Clouds, smoke, water, … Subsurface scattering: paint, skin,

CS348B Lecture 16 Pat Hanrahan, Spring 2005

Transmittance and Opacity

0

ln ( , ) ( ) ( )s

aL x s x s ds s

Transmittance

( , )( )

( , ) a

dL xx ds

L x

( , ) ( ) ( , )adL x x L x ds

( )( ) sT s e

( )( , ) ( , ) ( ) ( , )sL x s e L x T s L x

Opacity( ) 1 ( )s T s

Page 5: CS348B Lecture 16Pat Hanrahan, Spring 2005 Participating Media & Vol. Scattering Applications Clouds, smoke, water, … Subsurface scattering: paint, skin,

CS348B Lecture 16 Pat Hanrahan, Spring 2005

Out-Scatter

L dL( , )L x

ds

( )s x

( , ) ( ) ( , )sdL x x L x ds

sScattering cross-section:

Probability of being scattered per unit length

Page 6: CS348B Lecture 16Pat Hanrahan, Spring 2005 Participating Media & Vol. Scattering Applications Clouds, smoke, water, … Subsurface scattering: paint, skin,

CS348B Lecture 16 Pat Hanrahan, Spring 2005

Extinction

L dL( , )L x

ds

( )t x

( , ) ( ) ( , )tdL x x L x ds

t a s Total cross-section

0

( ) ( )s

ts x s ds Attenuation due to both absorption and scattering

s s

t a s

W

Albedo

Page 7: CS348B Lecture 16Pat Hanrahan, Spring 2005 Participating Media & Vol. Scattering Applications Clouds, smoke, water, … Subsurface scattering: paint, skin,

CS348B Lecture 16 Pat Hanrahan, Spring 2005

Black Clouds

From Greenler, Rainbows, halos and glories

Page 8: CS348B Lecture 16Pat Hanrahan, Spring 2005 Participating Media & Vol. Scattering Applications Clouds, smoke, water, … Subsurface scattering: paint, skin,

CS348B Lecture 16 Pat Hanrahan, Spring 2005

In-Scatter

2

( , ) ( ) ( ) ( , )s

S

S x x p L x d

L dL( , )L x

ds

( )s x

( ) ( )p p Reciprocity

2

( ) 1S

p d Energy conserving

Phase function ( )p

Page 9: CS348B Lecture 16Pat Hanrahan, Spring 2005 Participating Media & Vol. Scattering Applications Clouds, smoke, water, … Subsurface scattering: paint, skin,

CS348B Lecture 16 Pat Hanrahan, Spring 2005

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

Page 10: CS348B Lecture 16Pat Hanrahan, Spring 2005 Participating Media & Vol. Scattering Applications Clouds, smoke, water, … Subsurface scattering: paint, skin,

CS348B Lecture 16 Pat Hanrahan, Spring 2005

Blue Sky = Red Sunset

From Greenler, Rainbows, halos and glories

Page 11: CS348B Lecture 16Pat Hanrahan, Spring 2005 Participating Media & Vol. Scattering Applications Clouds, smoke, water, … Subsurface scattering: paint, skin,

CS348B Lecture 16 Pat Hanrahan, Spring 2005

Coronas and Halos

Moon Corona Sun Halos

From Greenler, Rainbows, halos and glories

Page 12: CS348B Lecture 16Pat Hanrahan, Spring 2005 Participating Media & Vol. Scattering Applications Clouds, smoke, water, … Subsurface scattering: paint, skin,

CS348B Lecture 16 Pat Hanrahan, Spring 2005

Henyey-Greenstein Phase Function

2

32 2

1 1(cos )

4 1 2 cos

gp

g g

Empirical phase function

0

2 (cos )cosp d g

g: average phase angle

g = -0.3

g = 0.6

Page 13: CS348B Lecture 16Pat Hanrahan, Spring 2005 Participating Media & Vol. Scattering Applications Clouds, smoke, water, … Subsurface scattering: paint, skin,

CS348B Lecture 16 Pat Hanrahan, Spring 2005

The Volume Rendering Equation

Integro-differential equation

Integro-integral equation

Attenuation: Absorption and scattering

Source: Scatter (+ emission)

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

L xx L x S x

s

0

( )

0

( , ) ( )

s

t x s ds

L x e S x s ds

Page 14: CS348B Lecture 16Pat Hanrahan, Spring 2005 Participating Media & Vol. Scattering Applications Clouds, smoke, water, … Subsurface scattering: paint, skin,

CS348B Lecture 16 Pat Hanrahan, Spring 2005

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 S C

Page 15: CS348B Lecture 16Pat Hanrahan, Spring 2005 Participating Media & Vol. Scattering Applications Clouds, smoke, water, … Subsurface scattering: paint, skin,

CS348B Lecture 16 Pat Hanrahan, Spring 2005

The Sky

From Greenler, Rainbows, halos and glories

Page 16: CS348B Lecture 16Pat Hanrahan, Spring 2005 Participating Media & Vol. Scattering Applications Clouds, smoke, water, … Subsurface scattering: paint, skin,

CS348B Lecture 16 Pat Hanrahan, Spring 2005

Atmospheric Perspective

From Greenler, Rainbows, halos and glories

Page 17: CS348B Lecture 16Pat Hanrahan, Spring 2005 Participating Media & Vol. Scattering Applications Clouds, smoke, water, … Subsurface scattering: paint, skin,

CS348B Lecture 16 Pat Hanrahan, Spring 2005

Atmospheric Perspective

Aerial Perspective: loss of contrast and change in color

From Musgrave

Page 18: CS348B Lecture 16Pat Hanrahan, Spring 2005 Participating Media & Vol. Scattering Applications Clouds, smoke, water, … Subsurface scattering: paint, skin,

CS348B Lecture 16 Pat Hanrahan, Spring 2005

Semi-Infinite Homogenous Media

Reduced Intensity

Effective source term

Volume rendering equation

Integrating over depths

( , )cos ( , ) ( , )o

o t o o

L zL z S z

z

( , )( , ) (0, )izi iL z e L

( , )( , ) ( ) (0, )izo s i o iS z p e L

/ cos / cos

0

cos ( ) ( , ) ( )t o t iz zo o s i o iL e p e L dz

cos i cos o

cosz s cosdz ds

Page 19: CS348B Lecture 16Pat Hanrahan, Spring 2005 Participating Media & Vol. Scattering Applications Clouds, smoke, water, … Subsurface scattering: paint, skin,

CS348B Lecture 16 Pat Hanrahan, Spring 2005

Semi-Infinite Homogenous Media

Integrating over depths

/ cos / cos

0

1 1

cos cos

0

cos ( ) ( , ) ( )

( , ) ( )

1( , ) ( )

1 1cos cos

cos cos( , ) ( )

cos cos

t o t i

ti o

z zo o s i o i

z

s i o i

s i o i

ti o

i oi o i

i o

L e p e L dz

p L e dz

p L

W p L

cos i cos o

Page 20: CS348B Lecture 16Pat Hanrahan, Spring 2005 Participating Media & Vol. Scattering Applications Clouds, smoke, water, … Subsurface scattering: paint, skin,

CS348B Lecture 16 Pat Hanrahan, Spring 2005

Semi-Infinite Homogenous Media

BRDF

Seeliger’s Law or The Law of Diffuse Reflection

( , )( , )

( )cos

1( , )

cos cos

i or i o

i i

i oi o

LdLf

dE L

W p

cos i cos o

Page 21: CS348B Lecture 16Pat Hanrahan, Spring 2005 Participating Media & Vol. Scattering Applications Clouds, smoke, water, … Subsurface scattering: paint, skin,

CS348B Lecture 16 Pat Hanrahan, Spring 2005

Subsurface Scattering

Skin

Page 22: CS348B Lecture 16Pat Hanrahan, Spring 2005 Participating Media & Vol. Scattering Applications Clouds, smoke, water, … Subsurface scattering: paint, skin,

CS348B Lecture 16 Pat Hanrahan, Spring 2005

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

Page 23: CS348B Lecture 16Pat Hanrahan, Spring 2005 Participating Media & Vol. Scattering Applications Clouds, smoke, water, … Subsurface scattering: paint, skin,

CS348B Lecture 16 Pat Hanrahan, Spring 2005

Scalar Volumes

Interpolation

Map scalars to optical properties( ), ( )s av v

1ls

ls

1ls

( ) trilinear( , , , , ( ))l lv s v i j k x s

Voxel

( , , )i j k

Page 24: CS348B Lecture 16Pat Hanrahan, Spring 2005 Participating Media & Vol. Scattering Applications Clouds, smoke, water, … Subsurface scattering: paint, skin,

CS348B Lecture 16 Pat Hanrahan, Spring 2005

Scalar Volumes

Scatter

s

s ds

s dsVoxel

( , , )i j k

( ( ), ) ( ) ( , ( ( ), )) ( , ( , ( )))s L s L LS x s s p x s x L x x x s

( , ( , ( )))s L LL x x x s

Page 25: CS348B Lecture 16Pat Hanrahan, Spring 2005 Participating Media & Vol. Scattering Applications Clouds, smoke, water, … Subsurface scattering: paint, skin,

CS348B Lecture 16 Pat Hanrahan, Spring 2005

Ray Marching

Primary ray

Direct Lighting

1

0

for( 0; 1; )

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

1 ( ( ))

s L s L L

t

T

L

s s s ds

S s p x s x L x x x s

L L TS s

T T x s s

Page 26: CS348B Lecture 16Pat Hanrahan, Spring 2005 Participating Media & Vol. Scattering Applications Clouds, smoke, water, … Subsurface scattering: paint, skin,

CS348B Lecture 16 Pat Hanrahan, Spring 2005

Ray Marching

Shadow ray

Direct Lighting

1

for( 0; 1; )

1 ( ( ))

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

s L s L L

T

t t t dt

T T x t t

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

Page 27: CS348B Lecture 16Pat Hanrahan, Spring 2005 Participating Media & Vol. Scattering Applications Clouds, smoke, water, … Subsurface scattering: paint, skin,

CS348B Lecture 16 Pat Hanrahan, Spring 2005

Beams of Light

From Greenler, Rainbows, halos and glories

From Minneart, Color and light in the open air

Page 28: CS348B Lecture 16Pat Hanrahan, Spring 2005 Participating Media & Vol. Scattering Applications Clouds, smoke, water, … Subsurface scattering: paint, skin,

CS348B Lecture 16 Pat Hanrahan, Spring 2005

Color and Opacity Volumes

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

Voxel

( , , )

( , , )* ( , , ), ( , , )

c i j k

C i j k A i j k A i j k

Page 29: CS348B Lecture 16Pat Hanrahan, Spring 2005 Participating Media & Vol. Scattering Applications Clouds, smoke, water, … Subsurface scattering: paint, skin,

CS348B Lecture 16 Pat Hanrahan, Spring 2005

Ray Marching

Primary ray

Direct Lighting

(0,0,0,0)

for( 0; 1; )

(1 ( )) ( )

C

s s s ds

C C C c s

Page 30: CS348B Lecture 16Pat Hanrahan, Spring 2005 Participating Media & Vol. Scattering Applications Clouds, smoke, water, … Subsurface scattering: paint, skin,

CS348B Lecture 16 Pat Hanrahan, Spring 2005

Volume Rendering Examples

From Marc Levoy

From Karl Heinz Hoehne