Specular Reflection Lecture 27 Mon, Nov 10, 2003.

Slides:



Advertisements
Similar presentations
Computer Graphics - Shading -
Advertisements

Computer Graphics I, Fall 2010 Shading II.
1 Graphics CSCI 343, Fall 2013 Lecture 18 Lighting and Shading.
CS 480/680 Computer Graphics Shading 2 Dr. Frederick C Harris, Jr.
Virtual Realism LIGHTING AND SHADING. Lighting & Shading Approximate physical reality Ray tracing: Follow light rays through a scene Accurate, but expensive.
1 Computer Graphics By : Mohammed abu Lamdy ITGD3107 University of Palestine Supervision: Assistant Professor Dr. Sana’a Wafa Al-Sayegh.
Lighting and Illumination Lighting is the major problem in computer graphics, for either realism or real-time compositions- harder than modeling Consider.
1. What is Lighting? 2 Example 1. Find the cubic polynomial or that passes through the four points and satisfies 1.As a photon Metal Insulator.
Based on slides created by Edward Angel
1 Angel: Interactive Computer Graphics 5E © Addison-Wesley 2009 Shading I.
University of New Mexico
Computer Graphics - Class 10
University of British Columbia CPSC 314 Computer Graphics Jan-Apr 2008 Tamara Munzner Lighting/Shading III Week.
Rendering (彩現 渲染).
Shading II CS4395: Computer Graphics 1 Mohan Sridharan Based on slides created by Edward Angel.
IMGD 1001: Illumination by Mark Claypool
Computer Graphics (Fall 2005) COMS 4160, Lecture 16: Illumination and Shading 1
1 CSCE 641: Computer Graphics Lighting Jinxiang Chai.
Objectives Learn to shade objects so their images appear three- dimensional Learn to shade objects so their images appear three- dimensional Introduce.
1 Angel: Interactive Computer Graphics 4E © Addison-Wesley 2006 Shading II Ed Angel Professor of Computer Science, Electrical and Computer Engineering,
University of British Columbia CPSC 314 Computer Graphics Jan-Apr 2005 Tamara Munzner Lighting and Shading Week.
6.1 Vis_04 Data Visualization Lecture 6 - A Rough Guide to Rendering.
CS5500 Computer Graphics March 26, Shading Reference: Ed Angel’s book.
1 Angel: Interactive Computer Graphics 4E © Addison-Wesley 2005 Shading I Ed Angel Professor of Computer Science, Electrical and Computer Engineering,
LIGHTING Part One - Theory based on Chapter 6. Lights in the real world Lights bounce off surfaces and reflect colors, scattering light in many directions.
Shading Surface can either (both) 1.Emit light. E.g. light bult 2.Reflect light. E.g. Mirror.
CS 480/680 Computer Graphics Shading I Dr. Frederick C Harris, Jr.
Illumination.
1 Introduction to Computer Graphics with WebGL Ed Angel Professor Emeritus of Computer Science Founding Director, Arts, Research, Technology and Science.
1 Shading I Shandong University Software College Instructor: Zhou Yuanfeng
Shading (introduction to rendering). Rendering  We know how to specify the geometry but how is the color calculated.
COMPUTER GRAPHICS CS 482 – FALL 2014 AUGUST 27, 2014 FIXED-FUNCTION 3D GRAPHICS MESH SPECIFICATION LIGHTING SPECIFICATION REFLECTION SHADING HIERARCHICAL.
Chi-Cheng Lin, Winona State University CS430 Computer Graphics Lighting and Shading.
Human Eye and Color Rays of light enter the pupil and strike the back of the eye (retina) – signals go to the optic nerve and eventually to the brain Retina.
CSC418 Computer Graphics n Illumination n Lights n Lightinging models.
Taku KomuraComputer Graphics Local Illumination and Shading Computer Graphics – Lecture 10 Taku Komura Institute for Perception, Action.
Steve Sterley. Real World Lighting Physical objects tend to interact with light in three ways: Absorption (black body) Reflection (mirror) Transmission.
CSE 381 – Advanced Game Programming GLSL Lighting.
Illumination.
Computer Graphics: Programming, Problem Solving, and Visual Communication Steve Cunningham California State University Stanislaus and Grinnell College.
1 Introduction to Computer Graphics with WebGL Ed Angel Professor Emeritus of Computer Science Founding Director, Arts, Research, Technology and Science.
Illumination and Shading
1 Introduction to Computer Graphics with WebGL Ed Angel Professor Emeritus of Computer Science Founding Director, Arts, Research, Technology and Science.
Course Introduction to virtual engineering Óbuda University John von Neumann Faculty of Informatics Institute of Applied Mathematics Lecture and laboratory.
RENDERING Introduction to Shading models – Flat and Smooth shading – Adding texture to faces – Adding shadows of objects – Building a camera in a program.
Lecture Fall 2001 Illumination and Shading in OpenGL Light Sources Empirical Illumination Shading Transforming Normals Tong-Yee Lee.
Introduction to Computer Graphics with WebGL
Local Illumination and Shading
Lighting and Shading Part 2. Global Ambient Light There are at least 8 OpenGL lights and 1 Global Ambient Setting the Global Ambient globalAmbient[] =
1 CSCE 441: Computer Graphics Lighting Jinxiang Chai.
OpenGL Shading. 2 Objectives Learn to shade objects so their images appear three-dimensional Introduce the types of light-material interactions Build.
Lighting and Reflection Angel Angel: Interactive Computer Graphics5E © Addison-Wesley
David Luebke3/16/2016 CS 551 / 645: Introductory Computer Graphics David Luebke
Computer Graphics Lecture 25 Fasih ur Rehman. Last Class Shading.
Illumination Models. Introduction 1 Illumination model: Given a point on a surface, what is the perceived color and intensity? Known as Lighting Model,
1 CSCE 441: Computer Graphics Lighting Jinxiang Chai.
Computer Graphics Ken-Yi Lee National Taiwan University (the slides are adapted from Bing-Yi Chen and Yung-Yu Chuang)
Computer Graphics: Illumination
Computer Graphics (Fall 2006) COMS 4160, Lecture 16: Illumination and Shading 1
Illumination and Shading. Illumination (Lighting) Model the interaction of light with surface points to determine their final color and brightness OpenGL.
Computer Graphics (fall,2010) School of Computer Science University of Seoul Minho Kim.
School of Computer Science
CSC461: Lecture 23 Shading Computation
CSE 470 Introduction to Computer Graphics Arizona State University
Lighting – Light Sources
Lighting – Material Properties
Isaac Gang University of Mary Hardin-Baylor
Computer Graphics (Fall 2003)
CS 480/680 Computer Graphics Shading.
Lighting Calculations
Presentation transcript:

Specular Reflection Lecture 27 Mon, Nov 10, 2003

Specular Reflection The intensity of specular reflected light varies with direction. The maximum intensity is in the “ideal” direction. Angle of reflection = angle of incidence.

Specular Reflection Specular reflection creates the appearance of “shininess.” Surfaces with a high specular reflection appear very shiny. Surfaces with a low specular reflection appear matte.

Example LampShader.exe

Blinn and Phong Lighting OpenGL uses the Blinn lighting model of specular reflection. However, we will first study the Phong lighting model since it seems more natural.

Phong Lighting The intensity of the reflection is a function of the angle between the viewer and the ideal direction r of reflection of light from the light source off the surface.

Phong Lighting P s n v Light Source Eye Surface r  Ideal Direction 

Phong Lighting To compute r, note that r + s equals twice the projection of s onto n. s n r rs 

Phong Lighting The projection of s onto n is (s  n)/(n  n)n = (s  n)n Therefore, r + s = 2(s  n)n and r = –s + 2(s  n)n

Computing Specular Reflection According to the Phong lighting model, the specular reflection is proportional to the cosine of the angle between v and r, raised to a power (called “shiny”). This is calculated as (r  v) shiny

Computing Specular Reflection Two other factors are Intensity of the incident light.  0  L s  1. Specular property of the surface.  0  m s  1. The formula for specular reflection is r s = L s m s (r  v) shiny

Computing Specular Reflection Of course, if s  n < 0 or if r  v < 0, then r s = 0. Why?

Blinn Lighting A slightly more efficient method is the Blinn lighting model. Let h be the halfway vector, the unit vector halfway between s and v. Use h  n instead of r  v. r s = L s m s (h  n) shiny

Blinn Lighting P s n v Light Source Eye Surface h  Halfway

Blinn Lighting How does h  n compare to s  v? If s, n, and v are coplanar, then the angle between h and n is half of the angle between s and v. Why is Blinn lighting more efficient? h is computed as h = (s + v)/|s + v|. This is more efficient to compute than r.

Emissive Lighting Emissive lighting is light that emitted by the surface itself. It is used for objects that are meant to glow. It is independent of all light sources and directions. Let m e be the intensity of the emissive light.

Computing the Shade of a Surface The total reflection from a point is the sum of the ambient, diffuse, and specular reflections and the emissive light. s a m a + L a m a + L d m d (s  n) + L s m s (h  n) shiny + m e

Lighting in OpenGL Since the diffuse and specular reflections depend on light sources, there is a separate contribution for each light source. OpenGL provides up to 8 light sources. Furthermore, there is a separate color component for each type of light. Red, green, blue.

The Lighting Model The complete formula for n lights is I = (s ar m ar + s ag m ag + s ab m ab ) +  0…n (L ar m ar + L ag m ag + L ag m ag ) +  0…n (L dr m dr + L dg m dg + L db m db )(s  n) +  0…n (L sr m sr + L sg m sg + L sb m sb )(h  n) shiny + (m er + m eg + m eb ).

The Lighting Model For each color, the computed value is “clamped” to the interval [0, 1]. If the value exceeds 1, then it is set to 1.

Gouraud Shading vs. Phong Shading Gouraud shading computes the specular reflection only at the vertices and then interpolates. This guarantees that the brightest reflection will be at a vertex (or along an edge).

Gouraud Shading vs. Phong Shading Phong shading interpolates (and normalizes) the normal vectors and then uses them to compute the specular reflection at each vertex. Phong shading is much more realistic. much less efficient.

Gouraud Shading vs. Phong Shading dim reflection dim reflection dim interpolated reflection Gouraud shading.

Gouraud Shading vs. Phong Shading bright reflection Phong shading. interpolated vectors dim reflection dim reflection