Download presentation
Presentation is loading. Please wait.
1
Reflection and Transmission
Ed Angel Professor of Computer Science, Electrical and Computer Engineering, and Media Arts Director, Arts Technology Center University of New Mexico Angel: Interactive Computer Graphics 5E © Addison-Wesley 2009
2
Angel: Interactive Computer Graphics 5E © Addison-Wesley 2009
Introduction Interactions between light and materials Blinn-Phong model Absorption Diffuse and specular reflections Purely local Reflection: Translucent surfaces Refraction Frensel effect Chromatic dispersion Angel: Interactive Computer Graphics 5E © Addison-Wesley 2009
3
Angel: Interactive Computer Graphics 5E © Addison-Wesley 2009
Global vs Local Most of these effects can only be computed in a global renderer such as a ray tracer Angel: Interactive Computer Graphics 5E © Addison-Wesley 2009
4
Angel: Interactive Computer Graphics 5E © Addison-Wesley 2009
Ray Tracing Ray tracers can make use of all these effects in a global calculation by tracing rays N R L T -N Angel: Interactive Computer Graphics 5E © Addison-Wesley 2009
5
Angel: Interactive Computer Graphics 5E © Addison-Wesley 2009
Environmental Map Can use all these effects Implement in Cg with vertex and fragment programs Angel: Interactive Computer Graphics 5E © Addison-Wesley 2009
6
Angel: Interactive Computer Graphics 5E © Addison-Wesley 2009
Refraction With pure refraction, all the light is transmitted but the angle of refraction is determined by Snell’s law ήl sin θl = ήt sin θt where ήl and ήt are the speed of light relative to the speed of light in a vacuum Let ή = ήl / ήt Angel: Interactive Computer Graphics 5E © Addison-Wesley 2009
7
Angel: Interactive Computer Graphics 5E © Addison-Wesley 2009
Computing T ή2 sin2θl = ή2 (1- cos2θl )= sin2θt = 1-cos2θt Solving for cos θt Assuming normalized vectors cos θt = T·N = (1- ή2 (1-cos2θl ))1/2 where cos θl = T·N T, N, and L must be coplanar T = a L + b N and T·T = 1 Solving T = -1/ ή L – (cos θt - 1/ ή cos θl ) N Angel: Interactive Computer Graphics 5E © Addison-Wesley 2009
8
Angel: Interactive Computer Graphics 5E © Addison-Wesley 2009
Notes Critical angle: total internal reflection 1= ή2 (1-cos2θl ) Snell’s law is a statement that light takes the shortest path (in time) Can apply to reflection maps (see Cg Tutorial) via vertex program Angel: Interactive Computer Graphics 5E © Addison-Wesley 2009
9
Angel: Interactive Computer Graphics 5E © Addison-Wesley 2009
Fresnel Effect Some light is reflected and some transmitted at surface between two materials Amount of light reflected is greatest at shallow angle Approximation: use affine combination of refracted and reflected colors where a = max (0, min(1, bias + scale (1 + L·N)power)) Angel: Interactive Computer Graphics 5E © Addison-Wesley 2009
10
Angel: Interactive Computer Graphics 5E © Addison-Wesley 2009
Chromatic Dispersion The refraction coefficient is actually a function of wavelength h = h(l) N L -N Tr Tg Tb Angel: Interactive Computer Graphics 5E © Addison-Wesley 2009
11
Chromatic Dispersion with Shaders
Easy to do with reflection maps Use three values of h Make use of vector operations Angel: Interactive Computer Graphics 5E © Addison-Wesley 2009
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.