Reflection and Transmission

Slides:



Advertisements
Similar presentations
Computer Graphics I, Fall 2010 Shading II.
Advertisements

Based on slides created by Edward Angel
1 Angel: Interactive Computer Graphics 5E © Addison-Wesley 2009 Shading I.
University of New Mexico
Reflection & Refraction of Light Reflection: specular (mirror) vs diffuse angle of incidence = angle of reflection Refraction: Snell’s Law n 1 sin 
1 Angel: Interactive Computer Graphics 4E © Addison-Wesley 2006 Shading II Ed Angel Professor of Computer Science, Electrical and Computer Engineering,
Reflection and Transmission Ed Angel Professor of Computer Science, Electrical and Computer Engineering, and Media Arts Director, Arts Technology Center.
1 Angel: Interactive Computer Graphics 4E © Addison-Wesley 2005 Shading I Ed Angel Professor of Computer Science, Electrical and Computer Engineering,
CS 480/680 Computer Graphics Shading I Dr. Frederick C Harris, Jr.
Fundamentals of Computer Graphics Part 6 Shading prof.ing.Václav Skala, CSc. University of West Bohemia Plzeň, Czech Republic ©2002 Prepared with Angel,E.:
1 Introduction to Computer Graphics with WebGL Ed Angel Professor Emeritus of Computer Science Founding Director, Arts, Research, Technology and Science.
1 Introduction to Computer Graphics with WebGL Ed Angel Professor Emeritus of Computer Science Founding Director, Arts, Research, Technology and Science.
Reflections Specular reflection is the perfect reflection of light from a surface. The law a reflection states that the direction of the incoming ray and.
CSC418 Computer Graphics n Illumination n Lights n Lightinging models.
1 Introduction to Computer Graphics with WebGL Ed Angel Professor Emeritus of Computer Science Founding Director, Arts, Research, Technology and Science.
1 Introduction to Computer Graphics with WebGL Ed Angel Professor Emeritus of Computer Science Founding Director, Arts, Research, Technology and Science.
1 Introduction to Computer Graphics with WebGL Ed Angel Professor Emeritus of Computer Science Founding Director, Arts, Research, Technology and Science.
Programmable Pipelines Ed Angel Professor of Computer Science, Electrical and Computer Engineering, and Media Arts Director, Arts Technology Center University.
1 Introduction to Computer Graphics with WebGL Ed Angel Professor Emeritus of Computer Science Founding Director, Arts, Research, Technology and Science.
1 Introduction to Computer Graphics with WebGL Ed Angel Professor Emeritus of Computer Science Founding Director, Arts, Research, Technology and Science.
1 Introduction to Computer Graphics with WebGL Ed Angel Professor Emeritus of Computer Science Founding Director, Arts, Research, Technology and Science.
Shading in OpenGL Ed Angel Professor Emeritus of Computer Science University of New Mexico 1 E. Angel and D. Shreiner: Interactive Computer Graphics 6E.
Introduction to Computer Graphics with WebGL
1 Introduction to Computer Graphics with WebGL Ed Angel Professor Emeritus of Computer Science Founding Director, Arts, Research, Technology and Science.
1 Introduction to Computer Graphics with WebGL Ed Angel Professor Emeritus of Computer Science Founding Director, Arts, Research, Technology and Science.
Light. Intensity calculation = wavelength I( ) = wavelength intensity of light reaching eye I( ) = I diff ( ) + I spec ( ) + I refl ( ) + I trans ( )
1 Introduction to Computer Graphics with WebGL Ed Angel Professor Emeritus of Computer Science Founding Director, Arts, Research, Technology and Science.
Environment Maps Ed Angel Professor Emeritus of Computer Science
Introduction to Computer Graphics with WebGL
Introduction to Computer Graphics with WebGL
Introduction to Computer Graphics with WebGL
Introduction to Computer Graphics with WebGL
Programmable Pipelines
LIGHT.
Ray Tracing Ed Angel Professor Emeritus of Computer Science
Radisoity Ed Angel Professor Emeritus of Computer Science
Sampling and Aliasing Ed Angel Professor Emeritus of Computer Science
Introduction to Computer Graphics with WebGL
Unit-7 Lighting and Shading
Introduction to Computer Graphics with WebGL
Introduction to Computer Graphics with WebGL
Introduction to Computer Graphics with WebGL
Shading II Ed Angel Professor of Computer Science, Electrical and Computer Engineering, and Media Arts University of New Mexico Angel: Interactive Computer.
Image Formation Ed Angel Professor Emeritus of Computer Science,
Models and Architectures
Models and Architectures
Introduction to Computer Graphics with WebGL
Introduction to Computer Graphics with WebGL
Interactions of Light With Matter
Introduction to Computer Graphics with WebGL
Introduction to Computer Graphics with WebGL
Introduction to Computer Graphics with WebGL
Introduction to Computer Graphics with WebGL
Introduction to Computer Graphics with WebGL
Introduction to Computer Graphics with WebGL
Introduction to Computer Graphics with WebGL
Introduction to Computer Graphics with WebGL
Fundamentals of Computer Graphics Part 6 Shading
Introduction to Computer Graphics with WebGL
Introduction to Computer Graphics with WebGL
Reflection and Refraction (Snell’s Law).
Isaac Gang University of Mary Hardin-Baylor
Introduction to Computer Graphics with WebGL
Introduction to Computer Graphics with WebGL
Texture Mapping Ed Angel Professor Emeritus of Computer Science
Illumination and Shading
Introduction to Computer Graphics with WebGL
Shading in OpenGL Ed Angel Professor Emeritus of Computer Science
Reflection and Transmission
Shading II Ed Angel Professor Emeritus of Computer Science
Presentation transcript:

Reflection and Transmission Ed Angel Professor Emeritus of Computer Science University of New Mexico E. Angel and D. Shreiner: Interactive Computer Graphics 6E © Addison-Wesley 2012

Introduction Interactions between light and materials Blinn-Phong model Absorption Diffuse and specular reflections Purely local Reflection: Translucent surfaces Refraction Frensel effect Chromatic dispersion E. Angel and D. Shreiner: Interactive Computer Graphics 6E © Addison-Wesley 2012

Global vs Local Most of these effects can only be computed in a global renderer such as a ray tracer E. Angel and D. Shreiner: Interactive Computer Graphics 6E © Addison-Wesley 2012

Ray Tracing Ray tracers can make use of all these effects in a global calculation by tracing rays N R L T -N E. Angel and D. Shreiner: Interactive Computer Graphics 6E © Addison-Wesley 2012

Environmental Map Can use all these effects Implement in Cg with vertex and fragment programs E. Angel and D. Shreiner: Interactive Computer Graphics 6E © Addison-Wesley 2012

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 E. Angel and D. Shreiner: Interactive Computer Graphics 6E © Addison-Wesley 2012

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 E. Angel and D. Shreiner: Interactive Computer Graphics 6E © Addison-Wesley 2012

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 E. Angel and D. Shreiner: Interactive Computer Graphics 6E © Addison-Wesley 2012

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)) E. Angel and D. Shreiner: Interactive Computer Graphics 6E © Addison-Wesley 2012

Chromatic Dispersion The refraction coefficient is actually a function of wavelength h = h(l) N L -N Tr Tg Tb E. Angel and D. Shreiner: Interactive Computer Graphics 6E © Addison-Wesley 2012

Chromatic Dispersion with Shaders Easy to do with reflection maps Use three values of h Make use of vector operations E. Angel and D. Shreiner: Interactive Computer Graphics 6E © Addison-Wesley 2012