1 Computer Graphics By : Mohammed abu Lamdy ITGD3107 University of Palestine Supervision: Assistant Professor Dr. Sana’a Wafa Al-Sayegh.

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.
Virtual Realism LIGHTING AND SHADING. Lighting & Shading Approximate physical reality Ray tracing: Follow light rays through a scene Accurate, but expensive.
1 Computer Graphics Chapter 9 Rendering. [9]-2RM Rendering Three dimensional object rendering is the set of collective processes which make the object.
Lighting and Illumination Lighting is the major problem in computer graphics, for either realism or real-time compositions- harder than modeling Consider.
Illumination and Shading
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
Illumination Model & Surface-rendering Method 박 경 와.
1 Angel: Interactive Computer Graphics 5E © Addison-Wesley 2009 Shading I.
University of New Mexico
Computer Graphics - Class 10
IMGD 1001: Illumination by Mark Claypool
Lighting and Shading Wen-Chieh (Steve) Lin
3/23/2005 © Dr. Zachary Wartell 1 Illumination Models and Surface- Rendering Methods.
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.
CS 376 Introduction to Computer Graphics 03 / 30 / 2007 Instructor: Michael Eckmann.
6.1 Vis_04 Data Visualization Lecture 6 - A Rough Guide to Rendering.
Illumination and Shading
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.
Aaron Bloomfield CS 445: Introduction to Graphics Fall 2006
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.
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.
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.
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.
CS 325 Introduction to Computer Graphics 03 / 24 / 2010 Instructor: Michael Eckmann.
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.
Lecture Fall 2001 Illumination and Shading in OpenGL Light Sources Empirical Illumination Shading Transforming Normals Tong-Yee Lee.
Specular Reflection Lecture 27 Mon, Nov 10, 2003.
Local Illumination and Shading
Illumination and Shading Prof. Lizhuang Ma Shanghai Jiao Tong University.
Where We Stand So far we know how to: –Transform between spaces –Rasterize –Decide what’s in front Next –Deciding its intensity and color.
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
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,
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 Ken-Yi Lee National Taiwan University (the slides are adapted from Bing-Yi Chen and Yung-Yu Chuang)
Computer Graphics: Illumination
Illumination Models and Surface-Rendering Methods CEng 477 Introduction to Computer Graphics.
Illumination and Shading Prof. Lizhuang Ma Shanghai Jiao Tong University.
Computer Graphics Chapter 9 Rendering.
Illumination and Shading
Isaac Gang University of Mary Hardin-Baylor
Illumination and Shading
Illumination Model 고려대학교 컴퓨터 그래픽스 연구실.
Illumination Model 고려대학교 컴퓨터 그래픽스 연구실.
CS 480/680 Computer Graphics Shading.
Presentation transcript:

1 Computer Graphics By : Mohammed abu Lamdy ITGD3107 University of Palestine Supervision: Assistant Professor Dr. Sana’a Wafa Al-Sayegh 2 nd Semester

2 Chapter 14 Illumination Models & Surface-Rendering Methods ITGD3107 Computer Graphics

3 Illumination Models & Surface- Rendering Methods Illumination model or a lighting model is the model for calculating light intensity at a single surface point. Surface rendering is a procedure for applying a lighting model to obtain pixel intensities for all the projected surface positions in a scene.

4 Surface rendering Surface rendering can be performed by applying the illumination model to every visible surface point, or the rendering can be accomplished by interpolating intensities across the surface from a small set of illumination-model calculations. Scan-line algorithms use interpolation schemes. Ray tracing algorithms invoke the illumination model at each pixel position. Surface-rendering procedures are termed surface- shading methods.

5 Illumination models Given the parameters: the optical properties of surfaces (opaque/transparent, shiny/dull, surface-texture); the relative positions of the surfaces in a scene; the color and positions of the light sources; the position and orientation of the viewing plane. Illumination models calculate the intensity projected from a particular surface point in a specified viewing direction.

6 Lecture Plane Light Sources Basic Illumination Models Ambient Light Diffuse Reflection Specular Reflection & Phong Model Combine Diffuse & Specular Reflections with Multiple Light Sources

7 Light Sources When we view an opaque nonluminous object, we see reflected light from the surfaces of the object. The total reflected light is the sum of the contributions from light sources and other reflecting surfaces in the scene. Light sources = light-emitting sources. Reflecting surfaces = light-reflecting sources.

8 Light Sources Light Source Reflecting Surfaces Fig. 1 Light viewed from an opaque surface is in general a combination of reflected light from a light source and reflections of light reflections from other surfaces.

9 Point Light Source The rays emitted from a point light radially diverge from the source. Approximation for sources that are small compared to the size of objects in the scene. A point light source is a fair approximation to a local light source such as a light bulb. The direction of the light to each point on a surface changes when a point light source is used. Fig. 2 Diverging ray paths from a point light source.

10 Distributed Light Source A nearby source, such as the long fluoresent light. All of the rays from a directional/distributed light source have the same direction, and no point of origin. It is as if the light source was infinitely far away from the surface that it is illuminating. Sunlight is an example of an infinite light source. Fig. 3 An object illuminated with a distributed light source.

11 Materials When light is incident on an opaque surface, part of it is reflected and part is absorbed. Shiny materials reflect more of the incident light, and dull surface absorb more of the incident light. For an illuminated transparent surface, some of the incident light will be reflected and some will be transmitted through the material.

12 Diffuse reflection Grainy surfaces scatter the reflected light in all directions. This scattered light is called diffuse reflection. The surface appears equally bright from all viewing directions. What we call the color of an object is the color of the diffuse reflection of the incident light. Fig. 4 Diffuse reflection from a surface.

13 Specular reflection Light sources create highlights, bright spots, called specular reflection. More pronounced on shiny surfaces than on dull. Fig. 5 Specular reflection superimposed on diffuse reflection vectors.

14 Basic Illumination Models Lighting calculations are based on: Optical properties of surfaces, such as glossy, matte, opaque, and transparent. This controls the amount of reflection and absorption of incident light. The background lighting conditions. The light-source specifications. All light sources are considered to be point sources, specified with a coordinate position and intensity value (color).

15 Ambient Light Even though an object in a scene is not directly lit it will still be visible. This is because light is reflected from nearby objects. Ambient light has no spatial or directional characteristics. The amount of ambient light incident on each object is a constant for all surfaces and over all directions. The amount of ambient light that is reflected by an object is independent of the objects position or orientation and depends only on the optical properties of the surface. Fig. 6 Ambient light shading.

16 Ambient Light The level of ambient light in a scene is a parameter I a, and each surface illuminated with this constant value. Illumination equation for ambient light is I = k a I a where I is the resulting intensity I a is the incident ambient light intensity k a is the object’s basic intensity, ambient- reflection coefficient.

17 Ambient Light - Example Fig. 7 An ambient illumination only.

18 Diffuse Reflection Diffuse reflections are constant over each surface in a scene, independent of the viewing direction. The amount of the incident light that is diffusely reflected can be set for each surface with parameter k d, the diffuse-reflection coefficient, or diffuse reflectivity. 0  k d  1; k d near 1 – highly reflective surface; k d near 0 – surface that absorbs most of the incident light; k d is a function of surface color;

19 Diffuse Reflection Even though there is equal light scattering in all direction from a surface, the brightness of the surface does depend on the orientation of the surface relative to the light source: (a)(b) Fig. 8 A surface perpendicular to the direction of the incident light (a) is more illuminated than an equal-sized surface at an oblique angle (b) to the incoming light direction.

20 Diffuse Reflection As the angle between the surface normal and the incoming light direction increases, les of the incident light falls on the surface. We denote the angle of incidence between the incoming light direction and the surface normal as . Thus, the amount of illumination depends on cos . If the incoming light from the source is perpendicular to the surface at a particular point, that point is fully illuminated.

21 Diffuse Reflection If I l is the intensity of the point Light source, then the diffuse reflection equation for a point on the surface can be written as I l,diff = k d I l cos  or I l,diff = k d I l (N. L) where N is the unit normal vector to a surface and L is the unit direction vector to the point light source from a position on the surface. Fig. 9 Angle of incidence  between the unit light-source direction vector L and the unit surface normal N. N L To Light Source 

22 Diffuse Reflection Figure 10 illustrates the illumination with diffuse reflection, using various values of parameter k d between 0 and1. Fig. 10 Series of pictures of sphere illuminated by diffuse reflection model only using different k d values (0.4, 0.55, 0.7, 0.85,1.0).

23 Diffuse Reflection We can combine the ambient and point-source intensity calculations to obtain an expression for the total diffuse reflection. I diff = k a I a +k d I l (N. L) where both k a and k d depend on surface material properties and are assigned values in the range from 0 to 1. Fig. 11 Series of pictures of sphere illuminated by ambient and diffuse reflection model. I a = I l = 1.0, k d = 0.4 and k a values (0.0, 0.15, 0.30, 0.45, 0.60).

24 Diffuse Reflection - Example Fig. 12 Individually shaded polygons with diffuse reflection.

25 Specular Reflection and the Phong Model Specular reflection is the result of total, or near total, reflection of the incident light in a concentrated region around the specular-reflection angle. Shiny surfaces have a narrow specular-reflection range. Dull surfaces have a wider reflection range.

26 Specular Reflection Figure 13 shows the specular reflection direction at a point on the illuminated surface. In this figure, R represents the unit vector in the direction of specular reflection; L – unit vector directed toward the point light source; V – unit vector pointing to the viewer from the surface position; Angle  is the viewing angle relative to the specular- reflection direction R. Fig. 13 Modeling specular reflection. N L To Light Source   R V 

27 Phong Model Phong model is an empirical model for calculating the specular-reflection range: Sets the intensity of specular reflection proportional to cos ns  ; Angle  assigned values in the range 0 o to 90 o, so that cos  values from 0 to 1; Specular-reflection parameter n s is determined by the type of surface, Specular-reflection coefficient k s equal to some value in the range 0 to 1 for each surface.

28 Phong Model Very shiny surface is modeled with a large value for n s (say, 100 or more); Small values are used for duller surfaces. For perfect reflector (perfect mirror), n s is infinite; N L R Shiny Surface (Large n s ) N L R Dull Surface (Small n s ) Fig. 14 Modeling specular reflection with parameter n s.

29 Phong Model cos ns   Fig. 15 Plots of cos ns  for several values of specular parameter n s.

30 Phong Model Phong specular-reflection model: I spec = k s I l cos ns  Since V and R are unit vectors in the viewing and specular-reflection directions, we can calculate the value of cos ns  with the dot product V. R. I spec = k s I l (V. R) ns Fig. 13 Modeling specular reflection. N L To Light Source   R V 

31 Phong Model R + L = (2N. L)N R = (2N. L)N-L N L R N.LN.L L Fig. 16 Calculation of vector R by considering projections onto the direction of the normal vector N.

32 Phong Model N L R V  Fig. 17 Halfway vector H along the bisector of the angle between L and V. H   =  /2 H = (L + V)/|(L + V)| I spec = k s I l (N. H) ns

33 Specular Reflection - Example Fig. 18 Phong shading polygons with specular reflection.

34 Combine Diffuse & Specular Reflections For a single point light source, we can model the combined diffuse and specular reflections from a point on an illuminated surface as I = I diff + I spec = k a I a + k d I l (N. L) + k s I l (N. H) ns

35 Combine Diffuse & Specular Reflections with Multiple Light Sources If we place more than one point source in a scene, we obtain the light reflection at any surface point by summering the contributions from the individual sources: I = k a I a +  n i=1 I li [k d (N. L i ) + k s (N. H i ) ns ]

36 Visible-line determination

37 Visible-surface determination with ambient illumination only

38 Individually shaded polygons with diffuse reflection

39 Gouraud shaded polygons with diffuse reflection

40 Gouraud shaded polygons with specular reflection

41 Phong shaded polygons with specular reflection

42 Curved surfaces with specular reflection