1 Graphics CSCI 343, Fall 2013 Lecture 18 Lighting and Shading.

Slides:



Advertisements
Similar presentations
Computer Graphics - Shading -
Advertisements

SI23 Introduction to Computer Graphics
5.1 si31_2001 SI31 Advanced Computer Graphics AGR Lecture 5 A Simple Reflection Model.
Illumination Lighting and Shading CSE 470/598 Introduction to Computer Graphics Arizona State University Dianne Hansford.
CAP 4703 Computer Graphic Methods Prof. Roy Levow Chapter 6.
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.
Light Issues in Computer Graphics Presented by Saleema Amershi.
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
Lighting and Shading Wen-Chieh (Steve) Lin
3/23/2005 © Dr. Zachary Wartell 1 Illumination Models and Surface- Rendering Methods.
1 CSCE 641: Computer Graphics Lighting Jinxiang Chai.
7M836 Animation & Rendering
Objectives Learn to shade objects so their images appear three- dimensional Learn to shade objects so their images appear three- dimensional Introduce.
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.
1 Angel: Interactive Computer Graphics 4E © Addison-Wesley 2005 Shading I Ed Angel Professor of Computer Science, Electrical and Computer Engineering,
Course Website: Computer Graphics 16: Illumination.
Lighting affects appearance. Light Source emits photons Photons travel in a straight line When they hit an object they: bounce off in a new direction.
Lighting & Shading.
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.
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.:
CS 445 / 645: Introductory Computer Graphics
1 Introduction to Computer Graphics with WebGL Ed Angel Professor Emeritus of Computer Science Founding Director, Arts, Research, Technology and Science.
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.
19/17/ :25 UML Graphics: Conceptual Model Real Object Human Eye Display Device Graphics System Synthetic Model Synthetic Camera Real Light Synthetic.
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.
Rendering Overview CSE 3541 Matt Boggus. Rendering Algorithmically generating a 2D image from 3D models Raster graphics.
David Luebke 1 10/26/2015 Lighting CS 445/645 Introduction to Computer Graphics David Luebke, Spring 2003.
CS 325 Introduction to Computer Graphics 03 / 26 / 2010 Instructor: Michael Eckmann.
Steve Sterley. Real World Lighting Physical objects tend to interact with light in three ways: Absorption (black body) Reflection (mirror) Transmission.
University of Texas at Austin CS 378 – Game Technology Don Fussell CS 378: Computer Game Technology Basic Rendering Pipeline and Shading Spring 2012.
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.
Illumination and Shading
1 Introduction to Computer Graphics with WebGL Ed Angel Professor Emeritus of Computer Science Founding Director, Arts, Research, Technology and Science.
CS447/ Realistic Rendering -- Shading-- Introduction to 2D and 3D Computer Graphics.
Specular Reflection Lecture 27 Mon, Nov 10, 2003.
Cornell CS465 Spring 2004 Lecture 4© 2004 Steve Marschner 1 Shading CS 465 Lecture 4.
Basic Lighting and Shading. The Important Properties of Light It can Reflect, bend, spread and scatter.
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
1 CSCE 441: Computer Graphics Lighting Jinxiang Chai.
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
7. Illumination Phong Illumination Diffuse, Specular and Ambient
CSE 470 Introduction to Computer Graphics Arizona State University
Isaac Gang University of Mary Hardin-Baylor
Lighting and Shading (I)
14th Lecture – Final Lecture
Computer Graphics Material Colours and Lighting
Computer Graphics (Fall 2003)
CS 480/680 Computer Graphics Shading.
Presentation transcript:

1 Graphics CSCI 343, Fall 2013 Lecture 18 Lighting and Shading

2 Dealing with Lighting Light may come from one or more sources and interacts with objects in the scene, sometimes in complex ways. We would like to develop a model for lighting and shading that can look natural, but be computed rapidly. We use a local model, in which we base calculations on: 1) Material properties of objects in the scene 2) Local Geometry of the surfaces 3) Locations and properties of light sources.

3 Light that Reaches the Viewer Light reaches the viewer either: 1) Directly from the light source 2) After being reflected off an object 3) After being reflected off multiple objects We consider only those light rays that reach the viewer (through the center of projection, or COP) after passing through the clipping volume.

4 Surface appearance The interaction of light with a surface determines whether the surface appears light or dark, dull or shiny. It also determines the color of the surface. When light hits a surface: Some is absorbed Some is reflected Some passes through (for translucent surfaces). R R t

5 Surface color and texture If a surface absorbs all frequencies except red, and reflects red light, it will appear red. Shiny objects have smooth surfaces and the reflection is in a small range of directions that closely resemble the angle of reflection of a mirror. Dull objects have rough surfaces that reflect light in all directions.

6 Types of Surfaces Specular surfaces reflect light in a narrow range of directions (close to the reflection angle of a mirror). Mirrors are perfectly specular. Diffuse surfaces scatter light in all directions. Example: flat wall paint. Also called matte surfaces. Translucent surfaces allow some light to pass through the surface. The light may come out at a different angle than it entered (due to refraction). specular diffuse translucent

7 Light Sources z x y I   A real light source is an object with a surface. Each point on the surface emits light in a given direction and with a given intensity for each wavelength: I(x, y, z,  ) To find the total light from the source, we must integrate over the entire surface. To simplify the process, we model light with 4 types of sources: 1)Ambient 2) Point source 3) Spot Light 4) Distant light Each light source emits different wavelengths with different intensities. We will model this as a function of red, green and blue wavelengths.

8 Ambient Light Ambient light is diffuse light that is about the same intensity everywhere. The light sources are distributed to provide uniform illumination. We model ambient light by I a, which has a uniform intensity at every point in the scene. As with all our light sources I a has red, green, and blue components:

9 Point Sources Point sources of light emit light equally in all directions. The intensity diminishes with the square of the distance from the source. To soften the edges of objects, use: where p p0p0

10 Spot Lights Spot lights are point sources that have a limited range of emitted light. Usually the intensity decreases with the distance of the light ray from the center of this range. IsIs psps  I   I = ? The exponent, e, determines how rapidly the function falls off. Larger values of e imply a faster drop off (i.e. a narrower spotlight). I = cos e 

11 Distant Light sources For light sources that are very far away, all the light hits the surface at approximately the same angle. We model the light rays as parallel, and perform calculations based on the direction of the light source (as opposed to the location of the light source).

12 The Phong Reflection Model The Phong reflection model leads to efficient computation of surface lighting and gives reasonably realistic renderings. It uses 4 vectors to calculate the color and intensity of a point on a surface. n = normal to the surface at p l = direction to light source v = direction to viewer (COP) r = direction of perfectly reflected ray (determined by n and l) p l n v r

13 Modeling light intensity In the Phong reflection model, we model the light intensity of reflected light at each point as the sum of ambient light, diffuse light, and specular reflection at that point: I = I a + I d + I s = L a R a + L d R d + L s R s We model the light source as having 3 components: L a, L d, L s The surface reflects these components by different amounts: R a, R d, R s We will consider each of the components separately.

14 Ambient Reflection The intensity of ambient light is the same at every point on the surface: L a The amount of light reflected is given by the reflection coefficient of the surface: R a = k a, where 0<=k a <=1 I a = k a L a

15 Diffuse Reflection A perfectly diffuse reflector scatters light equally in all directions. This is known as a Lambertian surface. Generally these are rough surfaces. The amount of light is determined by Lambert's law. where  is the angle between the normal to the surface (n) and the direction to the light source (l). BrighterDimmer n l If n and l are normalized to length one, then: Why?

16 Diffuse reflection continued Not all the light that hits a surface at a point is reflected. The amount of reflected light is determined by the reflection coefficient, k d. Finally, we can include an attenuation term to account for the distance, d, of the surface from the light source:

17 Specular Reflection Specular reflection provides highlights on the object. The angle of reflection = the angle of incidence  i =  r The amount of light seen by the viewer depends on the difference between the angle of r and the angle of the viewer, v. We will call this angle . l n r v  is the shininess coefficient. Higher values make the surface shinier.  = infinity is a mirror. 100 <  < 500 is metallic. ii rr 

18 The complete Phong reflection model Putting all the terms together gives the full Phong reflection model: