optical models jian huang, cs 594, spring 2002 this set of slides are modified from slides used by...

40
Optical Models Jian Huang, CS 594, Spring 2002 This set of slides are modified from slides used by Prof. Torsten Moeller, at Simon Fraser University, BC, Canada.

Upload: kathleen-atkins

Post on 29-Dec-2015

216 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Optical Models Jian Huang, CS 594, Spring 2002 This set of slides are modified from slides used by Prof. Torsten Moeller, at Simon Fraser University, BC,

Optical Models

Jian Huang, CS 594, Spring 2002

This set of slides are modified from slides used by Prof. Torsten Moeller, at Simon Fraser University, BC, Canada.

Page 2: Optical Models Jian Huang, CS 594, Spring 2002 This set of slides are modified from slides used by Prof. Torsten Moeller, at Simon Fraser University, BC,

Optical Models

• Nelson Max, “Optical Models”, IEEE Transactions on Visualization and Computer Graphics, Vol. 1, No. 2, 1995.

• Jim Blinn’s 1982 SIGGRAPH paper on scattering.

• The mathematical framework for light transport in volume rendering.

Page 3: Optical Models Jian Huang, CS 594, Spring 2002 This set of slides are modified from slides used by Prof. Torsten Moeller, at Simon Fraser University, BC,

Transport of Light• Determination of Intensity• Local - Diffuse and Specular• Global - Radiosity, Ray Tracing, Ultimate

Physcial• Mechanisms in Ultimate Model

– Emittance (+)

– Absorption (-)

– Scattering (+) (single vs. multiple)

Light

Observer

Page 4: Optical Models Jian Huang, CS 594, Spring 2002 This set of slides are modified from slides used by Prof. Torsten Moeller, at Simon Fraser University, BC,

Transport of Light• Typically based on - S. Chandrasekhar “Radiative

Transfer”, Oxford Universtiy Press 1950• Mathematically challenging • Approximate models required -

Blinn et al to the rescue• Over Operator -

only emission and absorption

Light

Observer

Page 5: Optical Models Jian Huang, CS 594, Spring 2002 This set of slides are modified from slides used by Prof. Torsten Moeller, at Simon Fraser University, BC,

Max - 1995

• Several cases:– Completely opaque or transparent voxels

– Variable opacity correction

– Self-emitting glow

– Self-emitting glow with opacity along viewing ray

– Single scattering of external illumination

– Multiple scattering

Page 6: Optical Models Jian Huang, CS 594, Spring 2002 This set of slides are modified from slides used by Prof. Torsten Moeller, at Simon Fraser University, BC,

Blinn - Assumptions

• Assumptions:– N - surface normal

– E - eye vector

– L - light vector

– T - surface thickness

– e - angle btw. E and N

– a - angle btw. E and Laka phase angle

– I - angle btw. N and L

a

LE

N

ei

Particles

T

Page 7: Optical Models Jian Huang, CS 594, Spring 2002 This set of slides are modified from slides used by Prof. Torsten Moeller, at Simon Fraser University, BC,

Blinn - Assumptions

• Assumptions (contd.):– particles are little spheres with

radius p

– n - number density (number of particles per unit volume)

– - cosine of angle e, i.e. N.E

– D - proportional volume of the cloud occupied by particles

a

LE

N

ei

Particles

T

3

3

4pnD

Page 8: Optical Models Jian Huang, CS 594, Spring 2002 This set of slides are modified from slides used by Prof. Torsten Moeller, at Simon Fraser University, BC,

Blinn – transparency (1)

• Expected particles in a volume will be nV

• Probability that there are no particles in the way can be modeled as a Poisson process:

• Hence the probability that the light is making it through those tubes is:

E L

t

Cylindersmust be empty

nVeVP ,0

E

L

Cylindersof Integration

t

Bottom Lit

Top Lit

TpnTpn

eeVP

2

0

2

,0

Page 9: Optical Models Jian Huang, CS 594, Spring 2002 This set of slides are modified from slides used by Prof. Torsten Moeller, at Simon Fraser University, BC,

Blinn – transparency (2)

• Transparency through the cloud:

• is called the optical depth

eTrE

-E

Tpn 2

T

Page 10: Optical Models Jian Huang, CS 594, Spring 2002 This set of slides are modified from slides used by Prof. Torsten Moeller, at Simon Fraser University, BC,

Max - absorption only

• I(s) = intensity at distance s along a ray• (s) = extinction coefficient

• T(s) = transparency between 0 and s

sIsds

dI

sTI

dttIsIs

0

0

exp0

Page 11: Optical Models Jian Huang, CS 594, Spring 2002 This set of slides are modified from slides used by Prof. Torsten Moeller, at Simon Fraser University, BC,

Max - absorption only

• Linear variation of

2

0exp

exp0

DD

dttsTD

t

D

D)

0)

Page 12: Optical Models Jian Huang, CS 594, Spring 2002 This set of slides are modified from slides used by Prof. Torsten Moeller, at Simon Fraser University, BC,

Max - absorption only

• On the opacity

• assuming to be constant in the interval

...2/

exp1

exp11

2

0

DD

D

dttsTD

Page 13: Optical Models Jian Huang, CS 594, Spring 2002 This set of slides are modified from slides used by Prof. Torsten Moeller, at Simon Fraser University, BC,

Max - cloud model

• Using fractal structure (Perlin)

Page 14: Optical Models Jian Huang, CS 594, Spring 2002 This set of slides are modified from slides used by Prof. Torsten Moeller, at Simon Fraser University, BC,

Max - self-emitting glow

• Without extinction:

sgds

dI

s

dttgIsI0

0

Page 15: Optical Models Jian Huang, CS 594, Spring 2002 This set of slides are modified from slides used by Prof. Torsten Moeller, at Simon Fraser University, BC,

Max - self-emitting glow

• Without extinction:

Page 16: Optical Models Jian Huang, CS 594, Spring 2002 This set of slides are modified from slides used by Prof. Torsten Moeller, at Simon Fraser University, BC,

Max - self-emitting glow

• With extinction:

sIssgds

dI

dsdttsgdttIDID D

s

D

00

0 expexp

dssTsgDTIDID

0

0

Page 17: Optical Models Jian Huang, CS 594, Spring 2002 This set of slides are modified from slides used by Prof. Torsten Moeller, at Simon Fraser University, BC,

• The continuous form:

• In general case, can not compute analytically

dsdttsgdttIDID D

s

D

00

0 expexp

Volume Ray Integral (1)

Page 18: Optical Models Jian Huang, CS 594, Spring 2002 This set of slides are modified from slides used by Prof. Torsten Moeller, at Simon Fraser University, BC,

Volume Ray Integration (2)• Practical Computation Method:

» note: x can be xi (different everywhere)

– which leads to the familiar BTF or FTB compositing …

dsdttsgdttIDID D

s

D

00

0 expexp

xxixxiti 1exp

011211

1 110

Itggtgtg

gttIDI

nnnnn

n

ii

n

ijj

n

ii

Page 19: Optical Models Jian Huang, CS 594, Spring 2002 This set of slides are modified from slides used by Prof. Torsten Moeller, at Simon Fraser University, BC,

g(s)

• g(s) could be:– Self-emitting particle glow– Reflected color, obtained via illumination

• The color is usually the sum of emitted color E and reflected color R

Page 20: Optical Models Jian Huang, CS 594, Spring 2002 This set of slides are modified from slides used by Prof. Torsten Moeller, at Simon Fraser University, BC,

Max - self-emitting glow

• Identical glowing spherical particles:• projected area a = r2

• surface glow color = C• number per unit volume = N•

• extinction coefficient = a N• added glow intensity per unit length

g = C a N = C

A

aNAdl

area total

area occluded

dl

A

Page 21: Optical Models Jian Huang, CS 594, Spring 2002 This set of slides are modified from slides used by Prof. Torsten Moeller, at Simon Fraser University, BC,

Max - self-emitting glow

• Special Case g=C: (and C constant)

• This is compositing color C on top of background I0

DTCDTIDI 10

D

D D

s

D D

s

dttC

dsdttsCdsdttsg

0

00

exp1

expexp

Page 22: Optical Models Jian Huang, CS 594, Spring 2002 This set of slides are modified from slides used by Prof. Torsten Moeller, at Simon Fraser University, BC,

Max - self-emitting glow

• For I0=0 and : varying according to f:

Page 23: Optical Models Jian Huang, CS 594, Spring 2002 This set of slides are modified from slides used by Prof. Torsten Moeller, at Simon Fraser University, BC,

Volume Ray Integration Equation

• Self-emitting glow, none constant color

dsdttssCdsdttsgD D

s

D D

s

00

exp)(exp

Page 24: Optical Models Jian Huang, CS 594, Spring 2002 This set of slides are modified from slides used by Prof. Torsten Moeller, at Simon Fraser University, BC,

Max - reflection

• i(x) = illumination reaching point x• = unit reflection direction vector• ’ = unit illumination direction vector• r(x,,’): BRDF

– for conventional surface shading effects

xixrxg ,,

xf

O

X

Page 25: Optical Models Jian Huang, CS 594, Spring 2002 This set of slides are modified from slides used by Prof. Torsten Moeller, at Simon Fraser University, BC,

Max - reflection

• For particle densities:

– w(x) = albedo• Blinn: assuming that the primary effect is from interaction of light

with one single particle

• albedo - proportion of light reflected from a particle: in the range of 0..1

– p(,’) = phase function

• still unrealistic external reflection of outside illumination

,,, pxxwxr

O

X

Page 26: Optical Models Jian Huang, CS 594, Spring 2002 This set of slides are modified from slides used by Prof. Torsten Moeller, at Simon Fraser University, BC,

Blinn - Phase Function

• “how” we see theparticles

• depends on the angle ofeye E and light vector L

• smooth drop off …

L E

L

E

L

E

a = 0

a = 90

a = 180

Top View EyeView

a0 180

a

Page 27: Optical Models Jian Huang, CS 594, Spring 2002 This set of slides are modified from slides used by Prof. Torsten Moeller, at Simon Fraser University, BC,

Blinn - Phase Function

• Many different models possible• Constant function

– size of particles much less then wavelength of the light

• Anisotropic– more light forward then backward - essentially our

diffuse shading

• Lambert surfaces– spheres reflect according to Lamberts law– physically based

1 a

axa cos1

aaaa cossin38

Page 28: Optical Models Jian Huang, CS 594, Spring 2002 This set of slides are modified from slides used by Prof. Torsten Moeller, at Simon Fraser University, BC,

Blinn - Phase Function

• Rayleigh Scattering– diffraction effects dominate

• Henyey-Greenstein– general model with good fit to empirical data

• Empirical Measurments– tabulated phase function

• sums of functions– weighted sum of functions - model different effects in

parallel

aa 2cos143

23

22 cos211 aggga

Page 29: Optical Models Jian Huang, CS 594, Spring 2002 This set of slides are modified from slides used by Prof. Torsten Moeller, at Simon Fraser University, BC,

Max - shadows

• Should account for transparency of volume between light source and point x:

• those are the “shadow feelers”• e.g. Kajiya’s two pass algorithm

0

exp, dttxLxi

O

X

Page 30: Optical Models Jian Huang, CS 594, Spring 2002 This set of slides are modified from slides used by Prof. Torsten Moeller, at Simon Fraser University, BC,

Max - shadows

Page 31: Optical Models Jian Huang, CS 594, Spring 2002 This set of slides are modified from slides used by Prof. Torsten Moeller, at Simon Fraser University, BC,

Max - multiple scattering

• I(x,): intensity at position x in direction • g(x,): source term (glow at x in direction )

dxIxrxg ,,,,4

dssTdxIsxr

DTDxIxID

0 4

0

,,,

,,

KIII 0

Page 32: Optical Models Jian Huang, CS 594, Spring 2002 This set of slides are modified from slides used by Prof. Torsten Moeller, at Simon Fraser University, BC,

Max - multiple scattering

• use radiosity ideas for the solution• simplified model - scattering is isotropic• i.e. g(x,) does not depend on :• then we can compute the total contribution of all

voxels to the iso-tropic scattering:

• where Fij are the “form factors” and ai are the albedo coefficients

• do a first pass like Kayija and collect external illumination in E(xi)

jj

ijii xgFxaxS

Page 33: Optical Models Jian Huang, CS 594, Spring 2002 This set of slides are modified from slides used by Prof. Torsten Moeller, at Simon Fraser University, BC,

Max - multiple scattering

• Results in big equation system

• we still need to solve the form factors• use an iterative solution method as in progressive

radiosity

jj

ijiii xgFxaxExg

03

02

00

0000

00

0

IKIKKII

KIIIKIKI

KIIKI

KIII

Page 34: Optical Models Jian Huang, CS 594, Spring 2002 This set of slides are modified from slides used by Prof. Torsten Moeller, at Simon Fraser University, BC,

Max - multiple scattering

• Different approach: Monte Carlo Method

• Trace a large representative selection of rays from light sources and absorb them, with probability proportional to , or scatter them, with probability proportional to r. Build up the distribution of light flux flowing through each voxel (in each direction).

Page 35: Optical Models Jian Huang, CS 594, Spring 2002 This set of slides are modified from slides used by Prof. Torsten Moeller, at Simon Fraser University, BC,

Max - multiple scattering

• In a view dependent rendering pass, do a final single scatter of this light distribution towards the eye:

dssTdxIsxr

DTDxIID

0 4

0

,,,

,,viewpoint

Page 36: Optical Models Jian Huang, CS 594, Spring 2002 This set of slides are modified from slides used by Prof. Torsten Moeller, at Simon Fraser University, BC,

Max - multiple scattering

• albedo = 0.99• 15 iterations were needed• cloud on a 24x24x18 volume• each iteration took

15 minutes• final 512x384

rendering took5 minutes

Page 37: Optical Models Jian Huang, CS 594, Spring 2002 This set of slides are modified from slides used by Prof. Torsten Moeller, at Simon Fraser University, BC,

Volumetric Ray Integration

color

opacity

object (color, opacity)

1.0

Page 38: Optical Models Jian Huang, CS 594, Spring 2002 This set of slides are modified from slides used by Prof. Torsten Moeller, at Simon Fraser University, BC,

Ray-casting - revisited

color c = c s s(1 - ) + c

opacity = s (1 - ) +

1.0

object (color, opacity)

volumetric compositingInterpolationkernel

Page 39: Optical Models Jian Huang, CS 594, Spring 2002 This set of slides are modified from slides used by Prof. Torsten Moeller, at Simon Fraser University, BC,

Volume Rendering Pipeline (Levoy’88)

Acquired values

Data Preparation

Prepared values

classificationshading

Voxel colors

Ray-tracing / resampling Ray-tracing / resampling

Sample colors

compositing

Voxel opacities

Sample opacities

Image Pixels

)1(

)1(

inout

inout CCC

)1(

)1(

inout

ininout CCC

Which one?

Page 40: Optical Models Jian Huang, CS 594, Spring 2002 This set of slides are modified from slides used by Prof. Torsten Moeller, at Simon Fraser University, BC,

Volume Rendering Pipeline (Wittenbrink et. al. 98)

• FTB color:

• BTF color:

• Opacity:

• The colors that are composited must be pre-weighted with opacity, i.e. associate color: – C’ = C