Course Website: Computer Graphics 16: Illumination.

Slides:



Advertisements
Similar presentations
OpenGL Course Notes Chapter 5: Lighting Jim Mims, Spring 2009.
Advertisements

SI23 Introduction to Computer Graphics
5.1 si31_2001 SI31 Advanced Computer Graphics AGR Lecture 5 A Simple Reflection Model.
Computer Vision Radiometry. Bahadir K. Gunturk2 Radiometry Radiometry is the part of image formation concerned with the relation among the amounts of.
1 Graphics CSCI 343, Fall 2013 Lecture 18 Lighting and Shading.
CAP 4703 Computer Graphic Methods Prof. Roy Levow Chapter 6.
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.
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
Rendering (彩現 渲染).
IMGD 1001: Illumination by Mark Claypool
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.
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.
LIGHTING JEFF CHASTINE 1. WHAT IS LIGHT? A very complex process Find a dark area – how is it being lit? Light bounces (mirrors, shiny objects) Light refracts.
Illumination.
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.
CSC418 Computer Graphics n Illumination n Lights n Lightinging models.
David Luebke 1 10/26/2015 Lighting CS 445/645 Introduction to Computer Graphics David Luebke, Spring 2003.
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.
University of Texas at Austin CS 378 – Game Technology Don Fussell CS 378: Computer Game Technology Basic Rendering Pipeline and Shading Spring 2012.
Illumination.
11/04/04© University of Wisconsin, CS559 Fall 2004 Last Time Visibility –Z-Buffer and transparency –A-buffer –Area subdivision –BSP Trees –Exact Cell-Portal.
Illumination and Shading
1 Introduction to Computer Graphics with WebGL Ed Angel Professor Emeritus of Computer Science Founding Director, Arts, Research, Technology and Science.
Photo-realistic Rendering and Global Illumination in Computer Graphics Spring 2012 Material Representation K. H. Ko School of Mechatronics Gwangju Institute.
CS 450: COMPUTER GRAPHICS BASIC ILLUMINATION SPRING 2015 DR. MICHAEL J. REALE.
Lecture Fall 2001 Illumination and Shading in OpenGL Light Sources Empirical Illumination Shading Transforming Normals Tong-Yee Lee.
Local Illumination and Shading
Where We Stand So far we know how to: –Transform between spaces –Rasterize –Decide what’s in front Next –Deciding its intensity and color.
Written by: Itzik Ben Shabat Technion - Israel Institute of Technology Faculty of Mechanical Engineering Laboratory for CAD & Lifecycle Engineering Lab.
1 CSCE 441: Computer Graphics Lighting Jinxiang Chai.
Illumination and Shading Sang Il Park Sejong University.
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.
David Luebke3/16/2016 CS 551 / 645: Introductory Computer Graphics David Luebke
Computer Graphics Lecture 25 Fasih ur Rehman. Last Class Shading.
CS552: Computer Graphics Lecture 33: Illumination and Shading.
Computer Graphics Lecture 30 Mathematics of Lighting and Shading - IV Taqdees A. Siddiqi
1 CSCE 441: Computer Graphics Lighting Jinxiang Chai.
Computer Graphics: Illumination
Illumination Models and Surface-Rendering Methods CEng 477 Introduction to Computer Graphics.
Illumination and Shading. Illumination (Lighting) Model the interaction of light with surface points to determine their final color and brightness OpenGL.
Chapter 5. Lighting Computer Graphics (spring, 2009) School of Computer Science University of Seoul.
Computer Graphics (fall,2010) School of Computer Science University of Seoul Minho Kim.
1 Dr. Scott Schaefer Lighting. 2/49 Lighting/Illumination Color is a function of how light reflects from surfaces to the eye Global illumination accounts.
7. Illumination Phong Illumination Diffuse, Specular and Ambient
© University of Wisconsin, CS559 Spring 2004
CSE 470 Introduction to Computer Graphics Arizona State University
Isaac Gang University of Mary Hardin-Baylor
Chapter IX Lighting.
Lighting and Shading (I)
Computer Graphics Material Colours and Lighting
CS 480/680 Computer Graphics Shading.
Lighting Calculations
Presentation transcript:

Course Website: Computer Graphics 16: Illumination

2 of 50 Contents Today we will start to look at illumination models in computer graphics –Why do we need illumination models? –Different kinds of lights –Different kinds of reflections –Basic lighting model

3 of 50 Why Lighting? If we don’t have lighting effects nothing looks three dimensional!

4 of 50 Why Lighting? (cont…)

5 of 50 Point Light Sources A point source is the simplest model we can use for a light source We simply define: –The position of the light –The RGB values for the colour of the light Light is emitted in all directions Useful for small light sources

6 of 50 Radial Intensity Attenuation As light moves from a light source its intensity diminished At any distance d l away from the light source the intensity diminishes by a factor of However, using the factor does not produce very good results so we use something different

7 of 50 Radial Intensity Attenuation (cont…) We use instead in inverse quadratic function of the form: where the coefficients a 0, a 1, and a 2 can be varied to produce optimal results

8 of 50 Infinitely Distant Light Sources A large light source, like the sun, can be modelled as a point light source However, it will have very little directional effect Radial intensity attenuation is not used Images taken from Hearn & Baker, “Computer Graphics with OpenGL” (2004)

9 of 50 Directional Light Sources & Spotlights To turn a point light source into a spotlight we simply add a vector direction and an angular limit θ l Images taken from Hearn & Baker, “Computer Graphics with OpenGL” (2004)

10 of 50 Directional Light Sources & Spotlights (cont…) We can denote V light as the unit vector in the direction of the light and V obj as the unit vector from the light source to an object The dot-product of these two vectors gives us the angle between them If this angle is inside the light’s angular limit then the object is within the spotlight Images taken from Hearn & Baker, “Computer Graphics with OpenGL” (2004)

11 of 50 Angular Intensity Attenuation As well as light intensity decreasing as we move away from a light source, it also decreases angularly A commonly used function for calculating angular attenuation is: where the attenuation exponent a l is assigned some positive value and angle is measured from the cone axis

12 of 50 Reflected Light The colours that we perceive are determined by the nature of the light reflected from an object For example, if white light is shone onto a green object most wavelengths are absorbed, while green light is reflected from the object White Light Colours Absorbed Green Light

13 of 50 Surface Lighting Effects The amount of incident light reflected by a surface depends on the type of material Shiny materials reflect more of the incident light and dull surfaces absorb more of the incident light For transparent surfaces some of the light is also transmitted through the material

14 of 50 Diffuse Reflection Surfaces that are rough or grainy tend to reflect light in all directions This scattered light is called diffuse reflection

15 of 50 Specular Reflection Additionally to diffuse reflection some of the reflected light is concentrated into a highlight or bright spot This is called specular reflection

16 of 50 Ambient Light A surface that is not exposed to direct light may still be lit up by reflections from other nearby objects – ambient light The total reflected light from a surface is the sum of the contributions from light sources and reflected light

17 of 50 Example

18 of 50 Example Ambient Diffuse Specular Final Image

19 of 50 Nate Robin’s Tutorial Nate Robin’s OpenGL Tutorials available at:

20 of 50 Basic Illumination Model We will consider a basic illumination model which gives reasonably good results and is used in most graphics systems The important components are: –Ambient light –Diffuse reflection –Specular reflection For the most part we will consider only monochromatic light

21 of 50 Ambient Light To incorporate background light we simply set a general brightness level for a scene This approximates the global diffuse reflections from various surfaces within the scene We will denote this value as I a

22 of 50 Diffuse Reflection First we assume that surfaces reflect incident light with equal intensity in all directions Such surfaces are referred to as ideal diffuse reflectors or Lambertian reflectors

23 of 50 Diffuse Reflection (cont…) A parameter k d is set for each surface that determines the fraction of incident light that is to be scattered as diffuse reflections from that surface This parameter is known as the diffuse- reflection coefficient or the diffuse reflectivity k d is assigned a value between 0.0 and 1.0 –0.0: dull surface that absorbs almost all light –1.0: shiny surface that reflects almost all light

24 of 50 Diffuse Reflection – Ambient Light For background lighting effects we can assume that every surface is fully illuminated by the scene’s ambient light I a Therefore the ambient contribution to the diffuse reflection is given as: Ambient light alone is very uninteresting so we need some other lights in a scene as well

25 of 50 Diffuse Reflection (cont…) When a surface is illuminated by a light source, the amount of incident light depends on the orientation of the surface relative to the light source direction

26 of 50 Diffuse Reflection The angle between the incoming light direction and a surface normal is referred to as the angle of incidence given as θ Images taken from Hearn & Baker, “Computer Graphics with OpenGL” (2004)

27 of 50 Diffuse Reflection (cont…) So the amount of incident light on a surface is given as: So we can model the diffuse reflections as:

28 of 50 Diffuse Reflection (cont…) Assuming we denote the normal for a surface as N and the unit direction vector to the light source as L then: So: Images taken from Hearn & Baker, “Computer Graphics with OpenGL” (2004)

29 of 50 Combining Ambient And Incident Diffuse Reflections To combine the diffuse reflections arising from ambient and incident light most graphics packages use two separate diffuse- reflection coefficients: –k a for ambient light –k d for incident light The total diffuse reflection equation for a single point source can then be given as:

30 of 50 Examples

31 of 50 Specular Reflection The bright spot that we see on a shiny surface is the result of near total of the incident light in a concentrated region around the specular reflection angle The specular reflection angle equals the angle of the incident light Images taken from Hearn & Baker, “Computer Graphics with OpenGL” (2004)

32 of 50 Specular Reflection (cont…) A perfect mirror reflects light only in the specular-reflection direction Other objects exhibit specular reflections over a finite range of viewing positions around vector R Images taken from Hearn & Baker, “Computer Graphics with OpenGL” (2004)

33 of 50 The Phong Specular Reflection Model The Phong specular reflection model or Phong model is an empirical model for calculating specular reflection range developed in 1973 by Phong Bui Tuong The Phong model sets the intensity of specular reflection as proportional to the angle between the viewing vector and the specular reflection vector Images taken from Hearn & Baker, “Computer Graphics with OpenGL” (2004)

34 of 50 The Phong Specular Reflection Model (cont…) So, the specular reflection intensity is proportional to The angle Φ can be varied between 0° and 90° so that cosΦ varies from 1.0 to 0.0 The specular-reflection exponent, n s is determined by the type of surface we want to display –Shiny surfaces have a very large value (>100) –Rough surfaces would have a value near 1

35 of 50 The Phong Specular Reflection Model (cont…) The graphs below show the effect of n s on the angular range in which we can expect to see specular reflections Images taken from Hearn & Baker, “Computer Graphics with OpenGL” (2004)

36 of 50 The Phong Specular Reflection Model (cont…) For some materials the amount of specular reflection depends heavily on the angle of the incident light Fresnel’s Laws of Reflection describe in great detail how specular reflections behave However, we don’t need to worry about this and instead approximate the specular effects with a constant specular reflection coefficient k s For an explanation of Fresnel’s laws try herehere

37 of 50 The Phong Specular Reflection Model (cont…) So the specular reflection intensity is given as: Remembering that we can say:

38 of 50 Example

39 of 50 Combining Diffuse & Specular Reflections For a single light source we can combine the effects of diffuse and specular reflections simply as follows:

40 of 50 Diffuse & Specular Reflections From Multiple Light Sources We can place any number of light sources in a scene We compute the diffuse and specular reflections as sums of the contributions from the various sources Common Exam Question

41 of 50 Adding Intensity Attenuation To incorporate radial and angular intensity attenuation into our model we simply adjust our equation to take these into account So, light intensity is now given as: where f radatten and f angatten are as discussed previously

42 of 50 RGB Colour Considerations For an RGB colour description each intensity specification is a three element vector So, for each light source: Similarly all parameters are given as vectors:

43 of 50 RGB Colour Considerations (cont…) Each component of the surface colour is then calculated with a separate expression For example:

44 of 50 Summary T create realistic (or even semi-realistic) looking scenes we must model light correctly To successfully model lighting effects we need to consider: –Ambient light –Diffuse reflections –Specular reflections

45 of 50