Top Banner
CS6620 Beer’s Law 1
14

Beer’s Law - The College of Engineering at the University of Utahcs6620/beers.pdf · 2010-02-03 · Source: jwills/renders/mm_beers.html. Color filtering ... Beer’s Law dI = -CIdx

Jun 24, 2018

Download

Documents

lekiet
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Beer’s Law - The College of Engineering at the University of Utahcs6620/beers.pdf · 2010-02-03 · Source: jwills/renders/mm_beers.html. Color filtering ... Beer’s Law dI = -CIdx

CS6620

Beer’s Law

1

Page 2: Beer’s Law - The College of Engineering at the University of Utahcs6620/beers.pdf · 2010-02-03 · Source: jwills/renders/mm_beers.html. Color filtering ... Beer’s Law dI = -CIdx

Color filteringTransparent materials appear colored because they absorb some of the light that passes through them

Amount of absorption depends on wavelength and distance traveled through the material

Source: http://graphics.ucsd.edu/~jwills/renders/mm_beers.html

Page 3: Beer’s Law - The College of Engineering at the University of Utahcs6620/beers.pdf · 2010-02-03 · Source: jwills/renders/mm_beers.html. Color filtering ... Beer’s Law dI = -CIdx

Color filtering

Note the differences in the color of the liquid and ice cubes between these two images

With filteringWithout filtering

Page 4: Beer’s Law - The College of Engineering at the University of Utahcs6620/beers.pdf · 2010-02-03 · Source: jwills/renders/mm_beers.html. Color filtering ... Beer’s Law dI = -CIdx

Color filtering

0

1

2

3

4

I1 = AI0 < I0

I0 I0

Id = AdI0

The transmission coefficient A (0 ≤ A ≤ 1) of a homogeneous material is the amount of absorption after one unit distance

I2 = A2I0 < I0

I3 = A3I0 < I0

I4 = A4I0 < I0

Page 5: Beer’s Law - The College of Engineering at the University of Utahcs6620/beers.pdf · 2010-02-03 · Source: jwills/renders/mm_beers.html. Color filtering ... Beer’s Law dI = -CIdx

Color filtering

0

0.25

0.50

0.75

1.00

0 2 4 6 8 10

A = 1A = 0.99A = 0.9A = 0.5A = 0.1

Distance

Atte

nuat

ion

Page 6: Beer’s Law - The College of Engineering at the University of Utahcs6620/beers.pdf · 2010-02-03 · Source: jwills/renders/mm_beers.html. Color filtering ... Beer’s Law dI = -CIdx

Relates the amount of absorption to the distance the light has traveled through the medium

As a ray travels through a medium, it loses intensity according to:

Beer’s Law

dI = -CIdx = -CIdIdx

I = ke-Cx

This equation is solved by the exponential:

Page 7: Beer’s Law - The College of Engineering at the University of Utahcs6620/beers.pdf · 2010-02-03 · Source: jwills/renders/mm_beers.html. Color filtering ... Beer’s Law dI = -CIdx

Beer’s lawRecall the transmission coefficient A, which is the attenuation after one unit of distance

To solve the exponential, apply the boundary conditions:

I(0) = I0

I(1) = AI0

Page 8: Beer’s Law - The College of Engineering at the University of Utahcs6620/beers.pdf · 2010-02-03 · Source: jwills/renders/mm_beers.html. Color filtering ... Beer’s Law dI = -CIdx

Beer’s LawThe first condition implies that:

while the second implies:

I(x) = I0e-Cx

AI0 = I0e-C

so:

-C = ln(A)

Page 9: Beer’s Law - The College of Engineering at the University of Utahcs6620/beers.pdf · 2010-02-03 · Source: jwills/renders/mm_beers.html. Color filtering ... Beer’s Law dI = -CIdx

Beer’s Law

I(x) = I0eln(A)x

Finally:

Page 10: Beer’s Law - The College of Engineering at the University of Utahcs6620/beers.pdf · 2010-02-03 · Source: jwills/renders/mm_beers.html. Color filtering ... Beer’s Law dI = -CIdx

Beer’s law + Total internal refraction

Page 11: Beer’s Law - The College of Engineering at the University of Utahcs6620/beers.pdf · 2010-02-03 · Source: jwills/renders/mm_beers.html. Color filtering ... Beer’s Law dI = -CIdx

Beer’s Law attenuationbeers _attenuation(double t){ return Color(exp(t*Ar ),exp(t*Ag ),exp(t*Ab ));}Where:Ar ,Ag ,Ab = ln(Er ), ln(Eb ), ln(Eb )

Note :Ergb is scale dependent

Page 12: Beer’s Law - The College of Engineering at the University of Utahcs6620/beers.pdf · 2010-02-03 · Source: jwills/renders/mm_beers.html. Color filtering ... Beer’s Law dI = -CIdx

Improved Dielectric shading(continued)

if depth of ray <maximum depth:

costheta22 = 1+cos theta2 −1( )

ηtmp2

if costheta22 < 0 Total internal reflection, trace reflection ray (Just like metal material) result += refl color*beers_attenuation(trefl ) else ... (next page)

Page 13: Beer’s Law - The College of Engineering at the University of Utahcs6620/beers.pdf · 2010-02-03 · Source: jwills/renders/mm_beers.html. Color filtering ... Beer’s Law dI = -CIdx

Improved Dielectric shading

(continued)

... (last page) else

costheta2= costheta22

cosm=min(costheta, costheta2)

Fr = R0 + 1− R0( ) 1− cosm( )5

Trace reflection ray, just like metal material if(entering) result += refl color*Fr

else result += refl color*Fr *beer _attenuation(trefl ) Ft = 1− Fr

transp direction = 1ηtmp

V+

cos thetaηtmp

− cos theta2⎛

⎝⎜⎞

⎠⎟N

Trace transparency ray if(entering) result += transp color*Ft *beer _attenuation(ttrans ) else result += transp color*Ft

Page 14: Beer’s Law - The College of Engineering at the University of Utahcs6620/beers.pdf · 2010-02-03 · Source: jwills/renders/mm_beers.html. Color filtering ... Beer’s Law dI = -CIdx

Beer’s law on ‘05 Program 4