Transparency
CS 6965 Fall 2011
Transparency CS 6965 Fall 2011 Transparency Light is an - - PowerPoint PPT Presentation
Transparency CS 6965 Fall 2011 Transparency Light is an electromagnetic wave Some materials conduct energy at visible frequencies CS 6965 Fall 2011 2 Transmitted rays plane of incidence i n r 1 1 1 boundary 2 t
CS 6965 Fall 2011
Fall 2011 CS 6965
at visible frequencies
2
Fall 2011 CS 6965
3
n r i t boundary η1 η2 plane of incidence θ2 θ1 θ1
Fall 2011 CS 6965
waves in space
c = 1 µ0ε0 µ0 : Electric permittivity of free space ε0:Magnetic permeability of free space
4
Fall 2011 CS 6965
v = 1 µε µ : Electrical permittivity of material ε:Magnetic permeability of material v ≤ c
5
Fall 2011 CS 6965
tAB = tAC + tBC = C − A va + B − C vb Simplify: By = 0 tAB = Cx − Ax
( )
2 + Ay 2
va + Bx − Cx
( )
2 + By 2
vb
6 2.00 2.25 2.50 2.75 3.00
0.2 0.4 0.6 0.8 1 t
Fall 2011 CS 6965
tAB = Cx − Ax
( )
2 + Ay 2
va + Bx − Cx
( )
2 + By 2
vb d dCx tAB = 0 = Cx − Ax va Cx − Ax
( )
2 + Ay 2 +
Cx − Bx vb Bx − Cx
( )
2 + By 2
0 = sinθa va + −sinθb vb vb sinθa = va sinθb sinθa sinθb = va vb
7
Fall 2011 CS 6965
8
Fall 2011 CS 6965
9
Medium Index of refraction Perfect vacuum 1.0 Air (1 atm, 20° C) 1.0003 Water 1.33 Acrylic 1.49 Crown glass 1.52 Diamond 2.42
Fall 2011 CS 6965
sinθ1 sinθ2 = v1 v2 = η2 η1 = η = η12
10
n r i t boundary η1 η2 plane of incidence θ2 θ1 θ1
Fall 2011 CS 6965
sinθ1 sinθ2 = η2 η1 = η = S1 S2 ,S2η = S1 cosθ1 = C1 = −N ⋅V cosθ2 = C2 = −N ⋅T Square both sides of S1η = S2 : S2
2η2 = S1 2
And use S2 + C 2 = 1 to get cosine forms : 1− C2
2
2
C2
2 = 1+
C1
2 −1
η2 C2 = 1+ C1
2 −1
η2
11
N V
V’ T θ2 θ1
Fall 2011 CS 6965
T = − ʹ″ N + k ʹ″ V + ʹ″ N
( ) = k ʹ″
V + (k −1) ʹ″ N T = 1 ʹ″ N = C2 N ʹ″ V C1 = − ʹ″ N , ʹ″ V = − ʹ″ N C1 , ʹ″ V = C2 C1 ʹ″ V = C2 C1 V k = S2 S1 T ʹ″ V = S2 S1 1 C2 C1 = S2C1 C2S1
12
N V
V’ T θ2 θ1 V’+N’ k
Fall 2011 CS 6965
T = − ʹ″ N + k ʹ″ V + ʹ″ N
( ) = k ʹ″
V + (k −1) ʹ″ N k = S2 S1 T ʹ″ V = S2 S1 1 C2 C1 = S2C1 C2S1 C2 = 1+ C1
2 −1
( )
η2 T = S2C1 C2S1 C2 C1 V + S2C1 C2S1 −1 ⎛ ⎝ ⎜ ⎞ ⎠ ⎟ C2 N = S2 S1 V + S2 S1 C1 − C2 ⎛ ⎝ ⎜ ⎞ ⎠ ⎟ N = 1 ηV + 1 η C1 − C2 ⎛ ⎝ ⎜ ⎞ ⎠ ⎟ N = 1 ηV + C1 η − 1+ C1
2 −1
( )
η2 ⎛ ⎝ ⎜ ⎜ ⎞ ⎠ ⎟ ⎟ N
13
N V
V’ T θ2 θ1 V’+N’ k
Fall 2011 CS 6965
14
η2 η1 n r i t θ2 θ1 θ1
Fall 2011 CS 6965
15
η2 η1 n r i t θ2 θ1 θ1
Fall 2011 CS 6965
16
η2 η1 n r i t θ1 θ2 = π/2 θ1
Fall 2011 CS 6965
17
η2 η1 n r i t θ1 θ2 θ1 η2 η1 n r i t θ1 θ2 θ1
…
Fall 2011 CS 6965
18
η2 η1 n r i t θ1 θ2 = π/2 θ1
η2 η1 n r i θ1 θ1
Fall 2011 CS 6965
19
Fall 2011 CS 6965
20
Fall 2011 CS 6965
21
Fall 2011 CS 6965
22
i r1 t1
Fall 2011 CS 6965
23
Fall 2011 CS 6965
24
Fall 2011 CS 6965
25
Fall 2011 CS 6965
pseudocode
in something beside a vacuum, you must track current index of refraction
26
Fall 2011 CS 6965
diffuse reflection)
transmission)
27
Fall 2011 CS 6965
28
Fall 2011 CS 6965
29
Two choices:
Fall 2011 CS 6965
30
Fall 2011 CS 6965
31
Fall 2011 CS 6965
32
CS 6965 Fall 2011
Fall 2011 CS 6965
uniform color
properties as a function of space
34
Fall 2011 CS 6965
wood, etc.
35
Fall 2011 CS 6965
Compute hit position (P = O + tV ) Call primitive to get normal (N ) (normalized) costheta = −N ⋅V if (costheta < 0) normal =-normal Color light = scene.ambient*Ka foreach light source get CL and L dist= L ,Ln = L L cosphi = N ⋅ Ln if(cosphi > 0) if(!intersect with 0 < t < dist) light += CL *(Kd *cosphi) result=light*surface color
36
Fall 2011 CS 6965
Use hit position to determine image location P : hit position C : lower left corner of image U : image X axis in world space V : image Y axis in world space x, y: normalized image coordinates (0-1) P = C + xU + yV if U ⋅V = 0 : x = P − C
( )⋅U
U y = P − C
( )⋅V
V
37
P C x y U V Image
Fall 2011 CS 6965
x = P − C
U y = P − C
V ix = (int) x xres −1
( )
( ), fx = ix − x xres −1
( )
iy = (int) y yres −1
( )
( ), fy = iy − y yres −1
( )
Bilinear interpolation of image(ix,iy) - image(ix+1,iy+1) using fx,fy as interpolation factors Use interpolated color in lambertian shading
38
P C x y U V Image