Ligh%ng and Shading. Ligh%ng and Shading. q Is this a plate or a ball? q What color should I set for each pixel?

Size: px
Start display at page:

Download "Ligh%ng and Shading. Ligh%ng and Shading. q Is this a plate or a ball? q What color should I set for each pixel?"

Transcription

1 Ligh%ng and Shading Ligh%ng and Shading Is this a plate or a ball? What color should I set for each pixel? 1

2 Physical Reality As light hits the surface: Part is absorbed Part is reflected Visible light includes all colors of the rainbow Physical Reality Physically, objects can be said to have the color of the light leaving their surfaces: White Light Colours Absorbed Green Light If a blue object is illuminated with red light, it will appear as. 2

3 Our Objec%ve: Understand and model what light does in a scene. A Model for Ligh%ng Follow rays from light source Only light that reaches the eye is ever seen direct light is seen as the color of the light source indirect light depends on interac%on between material and light 3

4 Ligh%ng in Computer Graphics For Computer graphics we replace viewer with projec%on plane Rays which reach COP amer passing through viewing plane are actually seen Color of pixels is determined by our interac%on model Light- Material Interac%ons Determine whether an object appears red or brown, light or dark, dull or shiny Reflec%on of light from a surface can be: Specular Diffuse Translucent 4

5 Specular Surfaces Smooth, shiny, glossy Mirror- like Reflec%on focused to one direc%on (angle of incidence = angle of reflec%on) Diffuse Surfaces Rough (grainy, maue) Light reflected almost uniformly in all direc%ons 5

6 Translucent Surfaces Allow some light to pass through Glass or water- like Light- Material Interac%on Summary Surfaces may be Specular Diffuse Translucent A surface is never perfectly diffuse or perfectly translucent or perfectly specular. May have all these proper%es! To model these proper%es, we must understand how light reflects off each of these surface types. 6

7 Basic Illumina%on Model Basic Illumina%on Model We will consider a basic illumina%on model which gives reasonably good results and is used in most graphics systems The important components are: Diffuse reflec%on Specular reflec%on Ambient light 7

8 Example The total reflected light from a surface is the sum of the contribu%ons from light sources and reflected light Ambient Light Walk around the back of box. No light beams hit it directly. Can you see the back face? This type of indirect light is called ambient light. 8

9 Ambient Light Like sunlight on a totally clouded day! Uniform level of light, posi%on- independent Tells us how bright an object looks when no light source can directly reach it Ambient Light Also called background light Not created by any light source A constant ligh%ng from all direc%ons Contributed by scauered light in a surrounding When used alone, does not produce very interes%ng pictures Ambient light only 9

10 Ambient Light To incorporate background light we simply set a general brightness level I a for a scene Different surfaces may reflect different amount of ambient light, based on their reflectance proper%es. We model this by a constant factor for each surface: k a I a RGB Color Considera%ons For an RGB colour descrip%on each intensity specifica%on is a three element vector a ( I, I I ) I =, ar Similarly, the reflectance is given as a vector: a ag Red, green and blue ambient light intensi%es are ab ( k, k k ) k =, ar ag ab ( k I, k I, k I ) ar ar ag ag ab ab 10

11 Illumina%on: Ambient Light Material Color Ambient Light Color Hands- on Session Run the lightmaterial tutor, and right- click select Material Parameters Make the light source ambient- only (set all other material reflec%vity coefficients to 0). Try different color combina%ons of ambient light and material, and see how the scene reacts to these changes. 11

12 Diffuse Reflec%on Light scauered with equal intensity in all direc%ons (ideal diffuse reflec%on) Light from a point is independent on viewing direc%on (equally bright in all direc%ons) Intermezzo: Surface Normals N N where p0 is the center of the sphere 12

13 Diffuse Reflec%on The angle between the incoming light direc%on and a surface normal is referred to as the angle of incidence, denoted θ. L = unit vector to light source N = unit vector normal to surface Modeling Diffuse Reflec%on The amount of incident light depends on the orienta%on of the surface rela%ve to the light source direc%on. 13

14 Diffuse Reflec%on The amount of incident light on a surface depends on the angle of incidence: d L N N θ L? As θ increases, the brightness of the surface decreases by Recall: Dot Product N N L = N L cos θ L θ If N and L are unit vectors, then N L = cos θ 14

15 Diffuse Reflec%on If surface has brightness Ι when facing light, it has brightness Ι*cos(θ) when %lted at angle θ. N L θ N L = cos θ (N, L are unit vectors) You will see the brightness wriuen as I(N L) Diffuse Reflec%on A parameter k d set for each surface determines the frac%on of incident light scauered as diffuse reflec%ons from that surface This parameter is known as the diffuse reflec%on coefficient or the diffuse reflec%vity k d is assigned a value between 0.0 and for dull surface that absorbs almost all light 1.0 for shiny surface that reflects almost all light 15

16 Diffuse Reflec%on Diffuse reflec%ons: I d k = d I( N L) 0 if if N L > 0 N L 0 Diffuse Reflec%on Spheres lit by diffuse (k d ) values of 0.0, 0.25, 0.5, 0.75, 1 respec%vely 16

17 Ambient Light vs. Diffuse Light Ambient ligh%ng only Diffuse ligh%ng only Hands- on Session Run the lightmaterial tutor Make the light source diffuse- only Check the color of a blue object illuminated with red light Try different color combina%ons of diffuse light and material Change the light posi%on and observe the changes in the brightest spots on the torus Combine diffuse and ambient light 17

18 Diffuse Ligh%ng: What s Missing? Material Color Ambient Only Diffuse Only Ambient + Diffuse Ambient + diffuse reflec%ons produce shaded images that appear three- dimensional But the surfaces look dull, somewhat like chalk What is missing? Specular Reflec%on Intensity depends on where the viewer is! White specular highlight The white specular highlight is the reflec%on of white light from the source in the direc%on of the viewer 18

19 Specular Reflec%on The bright spot that we see on a shiny surface is the result of incident light reflected in a concentrated region around the specular reflec%on angle The specular reflec%on angle equals the angle of the incident light L = vector to light source N = vector normal to surface R = direc%on of reflected light V = vector to viewer Specular Reflec%on A perfect mirror reflects light only in the specular- reflec%on direc%on Other objects exhibit specular reflec%ons over a finite range of viewing posi%ons around vector R 19

20 The Phong Specular Reflec%on Model The Phong model sets the intensity of specular reflec%on as propor%onal to the angle φ between the viewing vector and the specular reflec%on vector: I s = I ks α cos φ α = shineness exponent k s = specular reflec%vity of material The Phong Specular Model I s = I ks α cos φ α = shininess k s = reflec%vity The shineness α 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 The larger the α, the more concentrated the light is around R. For mirrors, α à infinity. 20

21 I s = I ks The Phong Specular Model α cos α = shininess k s = reflec%vity φ Recall that R V = cos φ I s ksi = ( V R) α if V R > 0 and N L > if V R < 0 or N L 0 Illumina%on: Specular Ligh%ng Material Color Specular Light Color Specular Ambient + Diffuse Ambient + Diffuse + Specular Create shining surface (surface perfectly reflects) Viewpoint dependent 21

22 Specular Reflec%on Example specular ( k s ) values of 0, 0.25, 0.5, 0.75, 1 constant shineness shininess ( α ) values of 5, 25, 75, 125, 225 constant k s Add a Diffuse Red Component 22

23 Phong Reflec%on Model Summary Due to the ambient light, nothing can be en%rely black Mirror reflec%ons are possible Can be computed very fast (used in VR and games) Very good approxima%on of diffuse surfaces Physically inaccurate Expressed in terms of vector geometry PuSng it All Together The intensity of light from one point is a sum of the diffuse, specular and ambient components: + + Dark Red ambient Bluish diffuse Specular Highlight I = I + I + I a d s 23

24 PuSng it All Together diffuse specular = 0 shininess = 0 specular diffuse = 0.5 shininess = shininess diffuse = 0.5 specular = 0.5 OpenGL Ligh%ng Func%ons 24

25 OpenGL Ligh%ng Func%ons OpenGL provides func%ons for sejng up point light sources and spotlights, selec%ng surface reflec%on coefficients choosing values for several parameters in the basic illumina%on model Implements the Phong reflec%on model Steps in OpenGL Ligh%ng 1. Enable ligh%ng and select shading model 2. Specify normals 3. Specify material proper%es 4. Specify lights 25

26 Enable Ligh%ng Calcula%ons Ligh%ng calcula%ons are enabled globally in an OpenGL program using glenable (GL_LIGHTING); Once ligh%ng is enabled, glcolor*() ignored Enable Individual Light Sources Up to eight light sources (GL_MAX_LIGHTS) can be included in a standard OpenGL implementa%on Some implementa%ons may allow more than 8 Each light source is referenced by its iden%fier: GL_LIGHT0, GL_LIGHT1,..., GL_LIGHT7 A light source is enabled with: glenable (lightname); Example: glenable (GL_LIGHT0); 26

27 gllightmodel(gl_light_model_two_sided, ) Either shade only the outside of polygons, or both sides How does OpenGL know what is the outside? 2. Specify Normals In OpenGL the normal vector is part of the state Set by glnormal*() glnormal3f(x, y, z); glnormal3fv(p); Usually we want to set the normal to have unit length so cosine calcula%ons are correct Length can be affected by transforma%ons Note that scaling does not preserve length glenable(gl_normalize) allows for autonormaliza%on at a performance penalty 27

28 Intermezzo: Normal for a Triangle n = (p 2 p 1 ) (p 1 - p 0 ) n normalize n n/ n p p 2 p 1 p 0 Note that right- hand rule determines outward face. Intermezzo: Vector Cross Product Use the right-hand rule to determine a x b. 28

29 Intermezzo: Unit Vectors i, j, k Intermezzo: Vector Cross Product 29

30 Normal for a Sphere Associate a normal with each vertex: glbegin( ) glnormal3f(x,y,z) glvertex3f(x,y,z) glend() 3. Specify Material Proper%es Reflec%vity coefficients: GLfloat mat_ambient[] = {0.2, 0.2, 0.2, 1.0}; GLfloat mat_diffuse[] = {1.0, 0.8, 0.0, 1.0}; GLfloat mat_specular[] = {1.0, 1.0, 1.0, 1.0}; GLfloat mat_shine = 100.0; Material proper%es: glmaterialfv(gl_front, GL_AMBIENT, mat_ambient); glmaterialfv(gl_front, GL_DIFFUSE, mat_diffuse); glmaterialfv(gl_front, GL_SPECULAR, mat_specular); glmaterialfv(gl_front, GL_SHININESS, mat_shine); The default is to light only front faces 30

31 Transparency Material proper%es are specified as RGBA values The A value can be used to make the surface translucent The default is that all surfaces are opaque regardless of A 4. Specify Light Sources Proper%es of a light source such as posi%on, type, color, auenua%on, and spotlight effects can be specified using gllight* (lightname, lightproperty, propertyvalue); Each light source is referenced by its iden%fier: GL_LIGHT0, GL_LIGHT1,..., GL_LIGHT7 31

32 Light Proper%es gllight* (lightname, lightproperty, propertyvalue); lightproperty can be one of: GL_POSITION GL_AMBIENT GL_DIFFUSE GL_SPECULAR GL_CONSTANT_ATTENUATION GL_LINEAR_ATTENUATION GL_QUADRATIC_ATTENUATION GL_SPOT_DIRECTION GL_SPOT_CUTOFF GL_SPOT_EXPONENT Example Sejng the posi%on of a point light source: Glfloat light0_pos[]={1.0, 2.0, 3,0, 1.0}; glenable(gl_lighting); glenable(gl_light0); gllightv(gl_light0, GL_POSITION, light0_pos); 32

33 Light Types Two types of lights Local (point) light sources that are near the objects Light sources at infinity The type of a light source is independent of the 3d posi%on we assign to a light source. It is determined by a fourth parameter value: 1.0 indicates local light source 0.0 indicates light source at infinity Local Light Source For a local light source, the emiued light radiates in all direc%ons and the posi%on of the light is used in the ligh%ng calcula%ons i.e., the light direc%on changes for every object In OpenGL, it is referred to as Posi%onal Light Point (Positional) Light (Emit in all directions) 33

34 Infinite Light Source For a light source at infinity, the emiued light radiates in one direc%on only and this direc%on is applied to all objects in the scene I.e., the light direc%on is constant for every object In OpenGL, it is referred to as Direc%onal Light Directional Light (Infinitely far away) Hands- on Session Run the lightposi-on tutor, play with light parameters (Point) Posi%onal light Direc%onal light 34

35 Light Source Colors You can specify three different color proper%es to a light source This is unrealis%cally flexible compared to real- world lights which have one color We can specify the ambient, diffuse, and specular components of a light source with different colors. Example Sejng the RGBA values for the ambient, diffuse and specular components of a point light source. GLfloat diffuse0[]={1.0, 0.0, 0.0, 1.0}; GLfloat ambient0[]={1.0, 0.0, 0.0, 1.0}; GLfloat specular0[]={1.0, 0.0, 0.0, 1.0}; Glfloat light0_pos[]={1.0, 2.0, 3,0, 1.0}; glenable(gl_lighting); glenable(gl_light0); gllightv(gl_light0, GL_POSITION, light0_pos); gllightv(gl_light0, GL_AMBIENT, ambient0); gllightv(gl_light0, GL_DIFFUSE, diffuse0); gllightv(gl_light0, GL_SPECULAR, specular0); 35

36 Example Black ambient White diffuse White specular Black ambient Red diffuse Blue specular OpenGL Light Defaults Light 0 is unique in having a default diffuse and specular sejng of fully bright white (1,1,1,1) saves us the hassle of sejng up lights All other lights have a default sejngs of totally dark (0,0,0,1). All lights also have a default posi%on of (0,0,1,0) this would effec%vely place it as a direc%onal light, facing forward, from just behind the camera 36

37 Spotlights a.k.a Direc%onal Light Sources Limit the light to a cone- shaped region of space Use gllightv to set Direc%on GL_SPOT_DIRECTION Cutoff (θ) GL_SPOT_CUTOFF AUenua%on(α) GL_SPOT_EXPONENT Propor%onal to cos α φ -θ φ θ Direc%onal Local Light Sources Example: GLfloat dirvector [] = {1.0, 0.0, 0.0}; gllighy (GL_LIGHT3, GL_SPOT_DIRECTION, dirvector); gllighy (GL_LIGHT3, GL_SPOT_CUTOFF, 30.0); gllighy (GL_LIGHT3, GL_SPOT_EXPONENT, 2.5); 37

38 Example Emissive Light Used to add a fixed color to surfaces. Do not add any actual light to the scene. GLfloat mat_emission[] = {0.0, 0.3, 0.3, 1.0}; glmaterialfv(gl_front, GL_EMISSION, mat_emission); 38

39 Emissive Light Example 3D sphere reflec%ng green emissive light. Effect similar to ambient light, un%l light sources are introduced. Apply a light source with red ambient light, red diffuse light, and white specular light. Same sphere, with no emissive light Global Ambient Light Ambient light depends on color of light sources A red light in a white room will cause a red ambient term that disappears when the light is turned off OpenGL also allows a global ambient term that is omen helpful for tes%ng: GLfloat global_ambient[] = {0.1, 0.1, 0.1, 1.0} gllightmodelfv(gl_light_model_ambient, global_ambient); 39

40 Light Aaenua%on in OpenGL AUenua%on: gllighy(gl_light0, GL_CONSTANT_ATTENUATION, a); gllighy(gl_light0, GL_LINEAR_ATTENUATION, b); gllighy(gl_light0, GL_QUADRATIC_ATTENUATION, c); Default OpenGL values: a = 1, b = 0, c = 0 (no auenua%on with distance) Applying Transforma%ons A light source is like an object in the scene and included in the scene descrip%on Geometric transforma%on matrices and viewing transforma%on matrices are applied to light posi%ons as applied to other objects If you want to fix your light posi%on rela%ve to the objects in your scene, you need to set the light posi%on amer you specify geometric and viewing transforma%ons If we want the light to move as the viewpoint moves, set its posi%on before glulookat(...) 40

41 Summary To successfully model ligh%ng effects, must consider: Ambient light Diffuse reflec%ons Specular reflec%ons Ambient component is independent of the surface orienta%on and viewer posi%on Diffuse component is independent of the viewer posi%on but depends on the rela%ve orienta%on of the light source and the surface In specular reflec%on the posi%on of the viewer is also important Polygonal Shading 41

42 Ligh%ng Revisited Light calcula%on so far is at ver%ces Vertex illumina%on from a light of intensity I = ambient + diffuse + specular α = ( k + k cosθ + k cos φ I a d s ) Pixel may not fall right on vertex Shading: calculates color of interior pixels Polygonal Shading Technique to render solid surfaces Determines how surfaces will be filled Process for compu%ng the color intensity value for each pixel contained in a polygon The most common shading techniques are: Flat Shading Gouraud Shading Phong Shading 42

43 Flat Shading Simplest, Cheapest, Fastest Shading Method Works well for objects really made of flat faces. Appearance depends on number of polygons for curved surface objects. Fills an en%re polygon with one color intensity This model is only valid (realis%c) if: The light source is imagined to be at infinity The viewer is at infinity The polygon is not an approximation to a curved surface Flat Shading in OpenGL Specify using glshademodel(gl_flat); The color at the first vertex will determine the shade of the whole polygon 43

44 Mach Band Effect Flat shading suffers from mach band effect human eyes accentuate the discon%nuity at the boundary Smooth Shading Fix the mach band effect remove edge discon%nuity Compute ligh%ng for more points on each face Two popular methods: Gouraud shading (used by OpenGL) Phong shading (beuer specular highlight, used in Blender, not in OpenGL) 44

45 Gourad Shading The default shading algorithm used in OpenGL: glshademodel(gl_smooth) Ligh%ng is calculated for each of the polygon ver%ces Colors are interpolated for interior pixels Flat Smooth Gourad Shading Per- vertex ligh%ng calcula%on Normal is needed for each vertex Per- vertex normal can be computed by averaging the adjacent face normals: n n = 1 + n2 3 + n4 + n 4 Requires knowledge about adjacent faces 45

46 Gourad Shading Use normals to compute vertex illumina%on (color) before the projec%on transforma%on Shade interior pixels: color interpola%on (normals not needed) Gouraud Shading Color Interpola%on Algorithm Interpolation along polygon edges Interpolation across polygon surfaces Given: Colors c 0,c 1, c 2,c 3 Coordinates of points colored c 0,c 1, c 2,c 3, c a, c b Determine the colors c a, c b using linear interpola%on. 46

47 Try It Out Given the coordinates: P0 = (0, 3) P1 = (1, 2) P2 = (0, 1) and normals n1, n2, and n3, we can use the Phong reflec%on model to obtain a color ci for each vertex. Let c0 = 60, c1 = 50, and c2 = 20. Find Ca and Cb for a scanline with coordinates Pa = (0, 1.8) Pb = (0.8, 1.8). Ca Cb Gourad Shading Problem Ligh%ng in the polygon interior can be inaccurate: 47

48 Phong Shading Instead of interpola%on, we calculate ligh%ng for each pixel inside the polygon (per pixel ligh%ng) Need normals for all the pixels not provided by user Phong shading algorithm interpolates the normals and compute ligh%ng for each pixel Phong Shading Interpola%on Over Normal Vector, NOT Vertex Color: Slower 48

49 Polygonal Shading Summary Gouraud shading Set vertex normals Calculate colors at ver%ces Interpolate colors across polygon Must calculate vertex normals! Must normalize vertex normals to unit length! Phong Shading Creates greater realism than Gouraud shading Computa5onally intense 49

CEng 477 Introduction to Computer Graphics Fall

CEng 477 Introduction to Computer Graphics Fall Illumination Models and Surface-Rendering Methods CEng 477 Introduction to Computer Graphics Fall 2007 2008 Illumination Models and Surface Rendering Methods In order to achieve realism in computer generated

More information

Overview. Shading. Shading. Why we need shading. Shading Light-material interactions Phong model Shading polygons Shading in OpenGL

Overview. Shading. Shading. Why we need shading. Shading Light-material interactions Phong model Shading polygons Shading in OpenGL Overview Shading Shading Light-material interactions Phong model Shading polygons Shading in OpenGL Why we need shading Suppose we build a model of a sphere using many polygons and color it with glcolor.

More information

Why we need shading?

Why we need shading? Why we need shading? Suppose we build a model of a sphere using many polygons and color it with glcolor. We get something like But we want Light-material interactions cause each point to have a different

More information

Three-Dimensional Graphics V. Guoying Zhao 1 / 55

Three-Dimensional Graphics V. Guoying Zhao 1 / 55 Computer Graphics Three-Dimensional Graphics V Guoying Zhao 1 / 55 Shading Guoying Zhao 2 / 55 Objectives Learn to shade objects so their images appear three-dimensional Introduce the types of light-material

More information

CS Surface Rendering

CS Surface Rendering CS10101001 Surface Rendering Junqiao Zhao 赵君峤 Department of Computer Science and Technology College of Electronics and Information Engineering Tongji University Surface rendering How do we choose a color

More information

Ligh%ng in OpenGL. The Phong Illumina%on Model. Vector Background

Ligh%ng in OpenGL. The Phong Illumina%on Model. Vector Background Ligh%ng in OpenGL The Phong Illumina%on Model Vector Background 1 Vector Dot Product The dot product of two vectors is a number:! x $ # 1 v 1 = # y 1 # " z 1 %! x $ # 2 v 2 = # y 2 # " z 2 % In GLSL you

More information

Illumination Model. The governing principles for computing the. Apply the lighting model at a set of points across the entire surface.

Illumination Model. The governing principles for computing the. Apply the lighting model at a set of points across the entire surface. Illumination and Shading Illumination (Lighting) Model the interaction of light with surface points to determine their final color and brightness OpenGL computes illumination at vertices illumination Shading

More information

Illumination and Shading

Illumination and Shading Illumination and Shading Illumination (Lighting) Model the interaction of light with surface points to determine their final color and brightness OpenGL computes illumination at vertices illumination Shading

More information

Ambient reflection. Jacobs University Visualization and Computer Graphics Lab : Graphics and Visualization 407

Ambient reflection. Jacobs University Visualization and Computer Graphics Lab : Graphics and Visualization 407 Ambient reflection Phong reflection is a local illumination model. It only considers the reflection of light that directly comes from the light source. It does not compute secondary reflection of light

More information

Computer Graphics. Illumination and Shading

Computer Graphics. Illumination and Shading () Illumination and Shading Dr. Ayman Eldeib Lighting So given a 3-D triangle and a 3-D viewpoint, we can set the right pixels But what color should those pixels be? If we re attempting to create a realistic

More information

Shading and Illumination

Shading and Illumination Shading and Illumination OpenGL Shading Without Shading With Shading Physics Bidirectional Reflectance Distribution Function (BRDF) f r (ω i,ω ) = dl(ω ) L(ω i )cosθ i dω i = dl(ω ) L(ω i )( ω i n)dω

More information

Reading. Shading. An abundance of photons. Introduction. Required: Angel , 6.5, Optional: Angel 6.4 OpenGL red book, chapter 5.

Reading. Shading. An abundance of photons. Introduction. Required: Angel , 6.5, Optional: Angel 6.4 OpenGL red book, chapter 5. Reading Required: Angel 6.1-6.3, 6.5, 6.7-6.8 Optional: Shading Angel 6.4 OpenGL red book, chapter 5. 1 2 Introduction An abundance of photons So far, we ve talked exclusively about geometry. Properly

More information

INF3320 Computer Graphics and Discrete Geometry

INF3320 Computer Graphics and Discrete Geometry INF3320 Computer Graphics and Discrete Geometry Visual appearance Christopher Dyken and Martin Reimers 23.09.2009 Page 1 Visual appearance Real Time Rendering: Chapter 5 Light Sources and materials Shading

More information

Reading. Shading. Introduction. An abundance of photons. Required: Angel , Optional: OpenGL red book, chapter 5.

Reading. Shading. Introduction. An abundance of photons. Required: Angel , Optional: OpenGL red book, chapter 5. Reading Required: Angel 6.1-6.5, 6.7-6.8 Optional: Shading OpenGL red book, chapter 5. 1 2 Introduction So far, we ve talked exclusively about geometry. What is the shape of an obect? How do I place it

More information

Lighting. CSC 7443: Scientific Information Visualization

Lighting. CSC 7443: Scientific Information Visualization Lighting Why Lighting? What light source is used and how the object response to the light makes difference Ocean looks bright bluish green in sunny day but dim gray green in cloudy day Lighting gives you

More information

Illumination and Shading ECE 567

Illumination and Shading ECE 567 Illumination and Shading ECE 567 Overview Lighting Models Ambient light Diffuse light Specular light Shading Models Flat shading Gouraud shading Phong shading OpenGL 2 Introduction To add realism to drawings

More information

CS5620 Intro to Computer Graphics

CS5620 Intro to Computer Graphics So Far wireframe hidden surfaces Next step 1 2 Light! Need to understand: How lighting works Types of lights Types of surfaces How shading works Shading algorithms What s Missing? Lighting vs. Shading

More information

CS 4731: Computer Graphics Lecture 16: Phong Illumination and Shading. Emmanuel Agu

CS 4731: Computer Graphics Lecture 16: Phong Illumination and Shading. Emmanuel Agu CS 4731: Computer Graphics Lecture 16: Phong Illumination and Shading Emmanuel Agu Recall: Setting Light Property Define colors and position a light GLfloat light_ambient[] = {0.0, 0.0, 0.0, 1.0}; GLfloat

More information

Illumination and Shading

Illumination and Shading Illumination and Shading Illumination (Lighting)! Model the interaction of light with surface points to determine their final color and brightness! The illumination can be computed either at vertices or

More information

CS Computer Graphics: Illumination and Shading I

CS Computer Graphics: Illumination and Shading I CS 543 - Computer Graphics: Illumination and Shading I by Robert W. Lindeman gogo@wpi.edu (with help from Emmanuel Agu ;-) Illumination and Shading Problem: Model light/surface point interactions to determine

More information

CS Computer Graphics: Illumination and Shading I

CS Computer Graphics: Illumination and Shading I CS 543 - Computer Graphics: Illumination and Shading I by Robert W. Lindeman gogo@wpi.edu (with help from Emmanuel Agu ;-) Illumination and Shading Problem: Model light/surface point interactions to determine

More information

Virtual Reality for Human Computer Interaction

Virtual Reality for Human Computer Interaction Virtual Reality for Human Computer Interaction Appearance: Lighting Representation of Light and Color Representation of Light and Color Do we need to represent all I! to represent a color C(I)? Representation

More information

Display Issues Week 5

Display Issues Week 5 CS 432/637 INTERACTIVE COMPUTER GRAPHICS Display Issues Week 5 David Breen Department of Computer Science Drexel University Based on material from Ed Angel, University of New Mexico Objectives Consider

More information

Illumination Models & Shading

Illumination Models & Shading Illumination Models & Shading Lighting vs. Shading Lighting Interaction between materials and light sources Physics Shading Determining the color of a pixel Computer Graphics ZBuffer(Scene) PutColor(x,y,Col(P));

More information

Today s class. Simple shadows Shading Lighting in OpenGL. Informationsteknologi. Wednesday, November 21, 2007 Computer Graphics - Class 10 1

Today s class. Simple shadows Shading Lighting in OpenGL. Informationsteknologi. Wednesday, November 21, 2007 Computer Graphics - Class 10 1 Today s class Simple shadows Shading Lighting in OpenGL Wednesday, November 21, 27 Computer Graphics - Class 1 1 Simple shadows Simple shadows can be gotten by using projection matrices Consider a light

More information

Lecture 17: Shading in OpenGL. CITS3003 Graphics & Animation

Lecture 17: Shading in OpenGL. CITS3003 Graphics & Animation Lecture 17: Shading in OpenGL CITS3003 Graphics & Animation E. Angel and D. Shreiner: Interactive Computer Graphics 6E Addison-Wesley 2012 Objectives Introduce the OpenGL shading methods - per vertex shading

More information

Computer Graphics. Shading. Based on slides by Dianna Xu, Bryn Mawr College

Computer Graphics. Shading. Based on slides by Dianna Xu, Bryn Mawr College Computer Graphics Shading Based on slides by Dianna Xu, Bryn Mawr College Image Synthesis and Shading Perception of 3D Objects Displays almost always 2 dimensional. Depth cues needed to restore the third

More information

Lecture 4 Advanced Computer Graphics (CS & SE )

Lecture 4 Advanced Computer Graphics (CS & SE ) Lecture 4 Advanced Computer Graphics (CS & SE 233.420) Topics Covered Animation Matrices Viewing Lighting Animating Interactive Programs Consider planet.c Want to animate rotating the Earth around the

More information

ECS 175 COMPUTER GRAPHICS. Ken Joy.! Winter 2014

ECS 175 COMPUTER GRAPHICS. Ken Joy.! Winter 2014 ECS 175 COMPUTER GRAPHICS Ken Joy Winter 2014 Shading To be able to model shading, we simplify Uniform Media no scattering of light Opaque Objects No Interreflection Point Light Sources RGB Color (eliminating

More information

Comp 410/510 Computer Graphics. Spring Shading

Comp 410/510 Computer Graphics. Spring Shading Comp 410/510 Computer Graphics Spring 2017 Shading Why we need shading Suppose we build a model of a sphere using many polygons and then color it using a fixed color. We get something like But we rather

More information

Shading , Fall 2004 Nancy Pollard Mark Tomczak

Shading , Fall 2004 Nancy Pollard Mark Tomczak 15-462, Fall 2004 Nancy Pollard Mark Tomczak Shading Shading Concepts Shading Equations Lambertian, Gouraud shading Phong Illumination Model Non-photorealistic rendering [Shirly, Ch. 8] Announcements Written

More information

Light Sources. Spotlight model

Light Sources. Spotlight model lecture 12 Light Sources sunlight (parallel) Sunny day model : "point source at infinity" - lighting - materials: diffuse, specular, ambient spotlight - shading: Flat vs. Gouraud vs Phong light bulb ambient

More information

Illumination & Shading: Part 1

Illumination & Shading: Part 1 Illumination & Shading: Part 1 Light Sources Empirical Illumination Shading Local vs Global Illumination Lecture 10 Comp 236 Spring 2005 Computer Graphics Jargon: Illumination Models Illumination - the

More information

Shading I Computer Graphics I, Fall 2008

Shading I Computer Graphics I, Fall 2008 Shading I 1 Objectives Learn to shade objects ==> images appear threedimensional Introduce types of light-material interactions Build simple reflection model Phong model Can be used with real time graphics

More information

Light Transport Baoquan Chen 2017

Light Transport Baoquan Chen 2017 Light Transport 1 Physics of Light and Color It s all electromagnetic (EM) radiation Different colors correspond to radiation of different wavelengths Intensity of each wavelength specified by amplitude

More information

Objectives Shading in OpenGL. Front and Back Faces. OpenGL shading. Introduce the OpenGL shading methods. Discuss polygonal shading

Objectives Shading in OpenGL. Front and Back Faces. OpenGL shading. Introduce the OpenGL shading methods. Discuss polygonal shading Objectives Shading in OpenGL Introduce the OpenGL shading methods - per vertex shading vs per fragment shading - Where to carry out Discuss polygonal shading - Flat - Smooth - Gouraud CITS3003 Graphics

More information

Shading. Brian Curless CSE 457 Spring 2015

Shading. Brian Curless CSE 457 Spring 2015 Shading Brian Curless CSE 457 Spring 2015 1 Reading Required: Angel chapter 5. Optional: OpenGL red book, chapter 5. 2 Basic 3D graphics With affine matrices, we can now transform virtual 3D objects in

More information

Shading. CSE 457 Winter 2015

Shading. CSE 457 Winter 2015 Shading CSE 457 Winter 2015 Reading Required: Angel chapter 5. Optional: OpenGL red book, chapter 5. 2 Basic 3D graphics With affine matrices, we can now transform virtual 3D objects in their local coordinate

More information

Today. Global illumination. Shading. Interactive applications. Rendering pipeline. Computergrafik. Shading Introduction Local shading models

Today. Global illumination. Shading. Interactive applications. Rendering pipeline. Computergrafik. Shading Introduction Local shading models Computergrafik Thomas Buchberger, Matthias Zwicker Universität Bern Herbst 2008 Today Introduction Local shading models Light sources strategies Compute interaction of light with surfaces Requires simulation

More information

5.2 Shading in OpenGL

5.2 Shading in OpenGL Fall 2017 CSCI 420: Computer Graphics 5.2 Shading in OpenGL Hao Li http://cs420.hao-li.com 1 Outline Normal Vectors in OpenGL Polygonal Shading Light Sources in OpenGL Material Properties in OpenGL Example:

More information

Methodology for Lecture. Importance of Lighting. Outline. Shading Models. Brief primer on Color. Foundations of Computer Graphics (Spring 2010)

Methodology for Lecture. Importance of Lighting. Outline. Shading Models. Brief primer on Color. Foundations of Computer Graphics (Spring 2010) Foundations of Computer Graphics (Spring 2010) CS 184, Lecture 11: OpenGL 3 http://inst.eecs.berkeley.edu/~cs184 Methodology for Lecture Lecture deals with lighting (teapot shaded as in HW1) Some Nate

More information

Lecture 15: Shading-I. CITS3003 Graphics & Animation

Lecture 15: Shading-I. CITS3003 Graphics & Animation Lecture 15: Shading-I CITS3003 Graphics & Animation E. Angel and D. Shreiner: Interactive Computer Graphics 6E Addison-Wesley 2012 Objectives Learn that with appropriate shading so objects appear as threedimensional

More information

Illumination & Shading

Illumination & Shading Illumination & Shading Goals Introduce the types of light-material interactions Build a simple reflection model---the Phong model--- that can be used with real time graphics hardware Why we need Illumination

More information

Virtual Reality for Human Computer Interaction

Virtual Reality for Human Computer Interaction Virtual Reality for Human Computer Interaction Appearance: Lighting Representation of Light and Color Do we need to represent all I! to represent a color C(I)? No we can approximate using a three-color

More information

Graphics and Visualization

Graphics and Visualization International University Bremen Spring Semester 2006 Recap Hierarchical Modeling Perspective vs Parallel Projection Representing solid objects Displaying Wireframe models is easy from a computational

More information

Illumination in Computer Graphics

Illumination in Computer Graphics Illumination in Computer Graphics Ann McNamara Illumination in Computer Graphics Definition of light sources. Analysis of interaction between light and objects in a scene. Rendering images that are faithful

More information

Illumination and Shading

Illumination and Shading Illumination and Shading Computer Graphics COMP 770 (236) Spring 2007 Instructor: Brandon Lloyd 2/14/07 1 From last time Texture mapping overview notation wrapping Perspective-correct interpolation Texture

More information

Shading in OpenGL. Outline. Defining and Maintaining Normals. Normalization. Enabling Lighting and Lights. Outline

Shading in OpenGL. Outline. Defining and Maintaining Normals. Normalization. Enabling Lighting and Lights. Outline CSCI 420 Computer Graphics Lecture 10 Shading in OpenGL Normal Vectors in OpenGL Polygonal Shading Light Source in OpenGL Material Properties in OpenGL Approximating a Sphere [Angel Ch. 6.5-6.9] Jernej

More information

Illumination & Shading I

Illumination & Shading I CS 543: Computer Graphics Illumination & Shading I Robert W. Lindeman Associate Professor Interactive Media & Game Development Department of Computer Science Worcester Polytechnic Institute gogo@wpi.edu

More information

w Foley, Section16.1 Reading

w Foley, Section16.1 Reading Shading w Foley, Section16.1 Reading Introduction So far, we ve talked exclusively about geometry. w What is the shape of an object? w How do I place it in a virtual 3D space? w How do I know which pixels

More information

CPSC 314 LIGHTING AND SHADING

CPSC 314 LIGHTING AND SHADING CPSC 314 LIGHTING AND SHADING UGRAD.CS.UBC.CA/~CS314 slide credits: Mikhail Bessmeltsev et al 1 THE RENDERING PIPELINE Vertices and attributes Vertex Shader Modelview transform Per-vertex attributes Vertex

More information

Reflection and Shading

Reflection and Shading Reflection and Shading R. J. Renka Department of Computer Science & Engineering University of North Texas 10/19/2015 Light Sources Realistic rendering requires that we model the interaction between light

More information

Shading. Why we need shading. Scattering. Shading. Objectives

Shading. Why we need shading. Scattering. Shading. Objectives Shading Why we need shading Objectives Learn to shade objects so their images appear three-dimensional Suppose we build a model of a sphere using many polygons and color it with glcolor. We get something

More information

CS Illumination and Shading. Slide 1

CS Illumination and Shading. Slide 1 CS 112 - Illumination and Shading Slide 1 Illumination/Lighting Interaction between light and surfaces Physics of optics and thermal radiation Very complex: Light bounces off several surface before reaching

More information

Sung-Eui Yoon ( 윤성의 )

Sung-Eui Yoon ( 윤성의 ) CS380: Computer Graphics Illumination and Shading Sung-Eui Yoon ( 윤성의 ) Course URL: http://sglab.kaist.ac.kr/~sungeui/cg/ Course Objectives (Ch. 10) Know how to consider lights during rendering models

More information

Visualisatie BMT. Rendering. Arjan Kok

Visualisatie BMT. Rendering. Arjan Kok Visualisatie BMT Rendering Arjan Kok a.j.f.kok@tue.nl 1 Lecture overview Color Rendering Illumination 2 Visualization pipeline Raw Data Data Enrichment/Enhancement Derived Data Visualization Mapping Abstract

More information

CS 148, Summer 2012 Introduction to Computer Graphics and Imaging

CS 148, Summer 2012 Introduction to Computer Graphics and Imaging http://www.ann.jussieu.fr/~frey/papers/scivi/cook%20r.l.,%20a%20reflectance%20model%20for%20computer%20graphics.pdf CS 148, Summer 2012 Introduction to Computer Graphics and Imaging f(~v 2 ) A 3 A 1 f(~v

More information

Objectives. Introduce the OpenGL shading Methods 1) Light and material functions on MV.js 2) per vertex vs per fragment shading 3) Where to carry out

Objectives. Introduce the OpenGL shading Methods 1) Light and material functions on MV.js 2) per vertex vs per fragment shading 3) Where to carry out Objectives Introduce the OpenGL shading Methods 1) Light and material functions on MV.js 2) per vertex vs per fragment shading 3) Where to carry out 1 Steps in OpenGL shading Enable shading and select

More information

CSE 167: Lecture #8: Lighting. Jürgen P. Schulze, Ph.D. University of California, San Diego Fall Quarter 2011

CSE 167: Lecture #8: Lighting. Jürgen P. Schulze, Ph.D. University of California, San Diego Fall Quarter 2011 CSE 167: Introduction to Computer Graphics Lecture #8: Lighting Jürgen P. Schulze, Ph.D. University of California, San Diego Fall Quarter 2011 Announcements Homework project #4 due Friday, October 28 Introduction:

More information

Computer Graphics Lighting

Computer Graphics Lighting Lighting 1 Mike Bailey mjb@cs.oregonstate.edu This work is licensed under a Creative Commons Attribution-NonCommercial- NoDerivatives 4.0 International License Lighting.pptx Why Do We Care About Lighting?

More information

Computer Graphics Lighting. Why Do We Care About Lighting?

Computer Graphics Lighting. Why Do We Care About Lighting? Lighting 1 Mike Bailey mjb@cs.oregonstate.edu This work is licensed under a Creative Commons Attribution-NonCommercial- NoDerivatives 4.0 International License Lighting.pptx Why Do We Care About Lighting?

More information

Today. Global illumination. Shading. Interactive applications. Rendering pipeline. Computergrafik. Shading Introduction Local shading models

Today. Global illumination. Shading. Interactive applications. Rendering pipeline. Computergrafik. Shading Introduction Local shading models Computergrafik Matthias Zwicker Universität Bern Herbst 2009 Today Introduction Local shading models Light sources strategies Compute interaction of light with surfaces Requires simulation of physics Global

More information

Color and Light CSCI 4229/5229 Computer Graphics Fall 2016

Color and Light CSCI 4229/5229 Computer Graphics Fall 2016 Color and Light CSCI 4229/5229 Computer Graphics Fall 2016 Solar Spectrum Human Trichromatic Color Perception Color Blindness Present to some degree in 8% of males and about 0.5% of females due to mutation

More information

Computer Graphics (CS 543) Lecture 8a: Per-Vertex lighting, Shading and Per-Fragment lighting

Computer Graphics (CS 543) Lecture 8a: Per-Vertex lighting, Shading and Per-Fragment lighting Computer Graphics (CS 543) Lecture 8a: Per-Vertex lighting, Shading and Per-Fragment lighting Prof Emmanuel Agu Computer Science Dept. Worcester Polytechnic Institute (WPI) Computation of Vectors To calculate

More information

CS 4600 Fall Utah School of Computing

CS 4600 Fall Utah School of Computing Lighting CS 4600 Fall 2015 Utah School of Computing Objectives Learn to shade objects so their images appear three-dimensional Introduce the types of light-material interactions Build a simple reflection

More information

Shading Intro. Shading & Lighting. Light and Matter. Light and Matter

Shading Intro. Shading & Lighting. Light and Matter. Light and Matter Shading Intro Shading & Lighting Move from flat to 3-D models Orthographic view of sphere was uniformly color, thus, a flat circle A circular shape with many gradations or shades of color Courtesy of Vincent

More information

Local Illumination. CMPT 361 Introduction to Computer Graphics Torsten Möller. Machiraju/Zhang/Möller

Local Illumination. CMPT 361 Introduction to Computer Graphics Torsten Möller. Machiraju/Zhang/Möller Local Illumination CMPT 361 Introduction to Computer Graphics Torsten Möller Graphics Pipeline Hardware Modelling Transform Visibility Illumination + Shading Perception, Interaction Color Texture/ Realism

More information

Rendering. Illumination Model. Wireframe rendering simple, ambiguous Color filling flat without any 3D information

Rendering. Illumination Model. Wireframe rendering simple, ambiguous Color filling flat without any 3D information llumination Model Wireframe rendering simple, ambiguous Color filling flat without any 3D information Requires modeling interaction of light with the object/surface to have a different color (shade in

More information

CSE 167: Introduction to Computer Graphics Lecture #6: Lights. Jürgen P. Schulze, Ph.D. University of California, San Diego Fall Quarter 2016

CSE 167: Introduction to Computer Graphics Lecture #6: Lights. Jürgen P. Schulze, Ph.D. University of California, San Diego Fall Quarter 2016 CSE 167: Introduction to Computer Graphics Lecture #6: Lights Jürgen P. Schulze, Ph.D. University of California, San Diego Fall Quarter 2016 Announcements Thursday in class: midterm #1 Closed book Material

More information

Computer Graphics. Illumination Models and Surface-Rendering Methods. Somsak Walairacht, Computer Engineering, KMITL

Computer Graphics. Illumination Models and Surface-Rendering Methods. Somsak Walairacht, Computer Engineering, KMITL Computer Graphics Chapter 10 llumination Models and Surface-Rendering Methods Somsak Walairacht, Computer Engineering, KMTL Outline Light Sources Surface Lighting Effects Basic llumination Models Polygon

More information

Lessons Learned from HW4. Shading. Objectives. Why we need shading. Shading. Scattering

Lessons Learned from HW4. Shading. Objectives. Why we need shading. Shading. Scattering Lessons Learned from HW Shading CS Interactive Computer Graphics Prof. David E. Breen Department of Computer Science Only have an idle() function if something is animated Set idle function to NULL, when

More information

Color and Light. CSCI 4229/5229 Computer Graphics Summer 2008

Color and Light. CSCI 4229/5229 Computer Graphics Summer 2008 Color and Light CSCI 4229/5229 Computer Graphics Summer 2008 Solar Spectrum Human Trichromatic Color Perception Are A and B the same? Color perception is relative Transmission,Absorption&Reflection Light

More information

CS 325 Computer Graphics

CS 325 Computer Graphics CS 325 Computer Graphics 04 / 02 / 2012 Instructor: Michael Eckmann Today s Topics Questions? Comments? Illumination modelling Ambient, Diffuse, Specular Reflection Surface Rendering / Shading models Flat

More information

Computer Graphics (CS 4731) Lecture 16: Lighting, Shading and Materials (Part 1)

Computer Graphics (CS 4731) Lecture 16: Lighting, Shading and Materials (Part 1) Computer Graphics (CS 4731) Lecture 16: Lighting, Shading and Materials (Part 1) Prof Emmanuel Agu Computer Science Dept. Worcester Polytechnic Institute (WPI) Why do we need Lighting & shading? Sphere

More information

CS452/552; EE465/505. Lighting & Shading

CS452/552; EE465/505. Lighting & Shading CS452/552; EE465/505 Lighting & Shading 2-17 15 Outline! More on Lighting and Shading Read: Angel Chapter 6 Lab2: due tonight use ASDW to move a 2D shape around; 1 to center Local Illumination! Approximate

More information

Projections and Hardware Rendering. Brian Curless CSE 557 Fall 2014

Projections and Hardware Rendering. Brian Curless CSE 557 Fall 2014 Projections and Hardware Rendering Brian Curless CSE 557 Fall 2014 1 Reading Required: Shirley, Ch. 7, Sec. 8.2, Ch. 18 Further reading: Foley, et al, Chapter 5.6 and Chapter 6 David F. Rogers and J. Alan

More information

Chapter 10. Surface-Rendering Methods. Somsak Walairacht, Computer Engineering, KMITL

Chapter 10. Surface-Rendering Methods. Somsak Walairacht, Computer Engineering, KMITL Computer Graphics Chapter 10 llumination Models and Surface-Rendering Methods Somsak Walairacht, Computer Engineering, KMTL 1 Outline Light Sources Surface Lighting Effects Basic llumination Models Polygon

More information

Lighting/Shading III. Week 7, Wed Mar 3

Lighting/Shading III. Week 7, Wed Mar 3 University of British Columbia CPSC 314 Computer Graphics Jan-Apr 2010 Tamara Munzner Lighting/Shading III Week 7, Wed Mar 3 http://www.ugrad.cs.ubc.ca/~cs314/vjan2010 reminders News don't need to tell

More information

WHY WE NEED SHADING. Suppose we build a model of a sphere using many polygons and color it with glcolor. We get something like.

WHY WE NEED SHADING. Suppose we build a model of a sphere using many polygons and color it with glcolor. We get something like. LIGHTING 1 OUTLINE Learn to light/shade objects so their images appear three-dimensional Introduce the types of light-material interactions Build a simple reflection model---the Phong model--- that can

More information

Today we will start to look at illumination models in computer graphics

Today we will start to look at illumination models in computer graphics 1 llumination Today we will start to look at illumination models in computer graphics Why do we need illumination models? Different kinds lights Different kinds reflections Basic lighting model 2 Why Lighting?

More information

Lights, Colour and Materials In OpenGL

Lights, Colour and Materials In OpenGL Illumination Models Lights, Colour and Materials In OpenGL Illumination models are used to generate the colour of an object s surface at a given point on that surface. The factors that govern the illumination

More information

Computer Graphics (CS 543) Lecture 7b: Intro to lighting, Shading and Materials + Phong Lighting Model

Computer Graphics (CS 543) Lecture 7b: Intro to lighting, Shading and Materials + Phong Lighting Model Computer Graphics (CS 543) Lecture 7b: Intro to lighting, Shading and Materials + Phong Lighting Model Prof Emmanuel Agu Computer Science Dept. Worcester Polytechnic Institute (WPI) Why do we need Lighting

More information

CS130 : Computer Graphics Lecture 8: Lighting and Shading. Tamar Shinar Computer Science & Engineering UC Riverside

CS130 : Computer Graphics Lecture 8: Lighting and Shading. Tamar Shinar Computer Science & Engineering UC Riverside CS130 : Computer Graphics Lecture 8: Lighting and Shading Tamar Shinar Computer Science & Engineering UC Riverside Why we need shading Suppose we build a model of a sphere using many polygons and color

More information

LIGHTING AND SHADING

LIGHTING AND SHADING DH2323 DGI15 INTRODUCTION TO COMPUTER GRAPHICS AND INTERACTION LIGHTING AND SHADING Christopher Peters HPCViz, KTH Royal Institute of Technology, Sweden chpeters@kth.se http://kth.academia.edu/christopheredwardpeters

More information

Topic 9: Lighting & Reflection models 9/10/2016. Spot the differences. Terminology. Two Components of Illumination. Ambient Light Source

Topic 9: Lighting & Reflection models 9/10/2016. Spot the differences. Terminology. Two Components of Illumination. Ambient Light Source Topic 9: Lighting & Reflection models Lighting & reflection The Phong reflection model diffuse component ambient component specular component Spot the differences Terminology Illumination The transport

More information

Illumination and Shading

Illumination and Shading CT4510: Computer Graphics Illumination and Shading BOCHANG MOON Photorealism The ultimate goal of rendering is to produce photo realistic images. i.e., rendered images should be indistinguishable from

More information

Introduction to Computer Graphics 7. Shading

Introduction to Computer Graphics 7. Shading Introduction to Computer Graphics 7. Shading National Chiao Tung Univ, Taiwan By: I-Chen Lin, Assistant Professor Textbook: Hearn and Baker, Computer Graphics, 3rd Ed., Prentice Hall Ref: E.Angel, Interactive

More information

University of British Columbia CPSC 314 Computer Graphics Sep-Dec Tamara Munzner (guest lecturing) Lighting/Shading

University of British Columbia CPSC 314 Computer Graphics Sep-Dec Tamara Munzner (guest lecturing) Lighting/Shading University of British Columbia CPSC 314 Computer Graphics Sep-Dec 2010 Tamara Munzner (guest lecturing) Lighting/Shading Lighting 2 Rendering Pipeline Geometry Database Model/View Transform. Lighting Perspective

More information

Introduction to Computer Graphics. Farhana Bandukwala, PhD Lecture 14: Light Interacting with Surfaces

Introduction to Computer Graphics. Farhana Bandukwala, PhD Lecture 14: Light Interacting with Surfaces Introduction to Computer Graphics Farhana Bandukwala, PhD Lecture 14: Light Interacting with Surfaces Outline Computational tools Reflection models Polygon shading Computation tools Surface normals Vector

More information

OpenGl Pipeline. triangles, lines, points, images. Per-vertex ops. Primitive assembly. Texturing. Rasterization. Per-fragment ops.

OpenGl Pipeline. triangles, lines, points, images. Per-vertex ops. Primitive assembly. Texturing. Rasterization. Per-fragment ops. OpenGl Pipeline Individual Vertices Transformed Vertices Commands Processor Per-vertex ops Primitive assembly triangles, lines, points, images Primitives Fragments Rasterization Texturing Per-fragment

More information

Lighting and Shading II. Angel and Shreiner: Interactive Computer Graphics 7E Addison-Wesley 2015

Lighting and Shading II. Angel and Shreiner: Interactive Computer Graphics 7E Addison-Wesley 2015 Lighting and Shading II 1 Objectives Continue discussion of shading Introduce modified Phong model Consider computation of required vectors 2 Ambient Light Ambient light is the result of multiple interactions

More information

CS452/552; EE465/505. Intro to Lighting

CS452/552; EE465/505. Intro to Lighting CS452/552; EE465/505 Intro to Lighting 2-10 15 Outline! Projection Normalization! Introduction to Lighting (and Shading) Read: Angel Chapter 5., sections 5.4-5.7 Parallel Projections Chapter 6, sections

More information

C O M P U T E R G R A P H I C S. Computer Graphics. Three-Dimensional Graphics V. Guoying Zhao 1 / 65

C O M P U T E R G R A P H I C S. Computer Graphics. Three-Dimensional Graphics V. Guoying Zhao 1 / 65 Computer Graphics Three-Dimensional Graphics V Guoying Zhao 1 / 65 Shading Guoying Zhao 2 / 65 Objectives Learn to shade objects so their images appear three-dimensional Introduce the types of light-material

More information

Lighting. Figure 10.1

Lighting. Figure 10.1 We have learned to build three-dimensional graphical models and to display them. However, if you render one of our models, you might be disappointed to see images that look flat and thus fail to show the

More information

Orthogonal Projection Matrices. Angel and Shreiner: Interactive Computer Graphics 7E Addison-Wesley 2015

Orthogonal Projection Matrices. Angel and Shreiner: Interactive Computer Graphics 7E Addison-Wesley 2015 Orthogonal Projection Matrices 1 Objectives Derive the projection matrices used for standard orthogonal projections Introduce oblique projections Introduce projection normalization 2 Normalization Rather

More information

Topic 9: Lighting & Reflection models. Lighting & reflection The Phong reflection model diffuse component ambient component specular component

Topic 9: Lighting & Reflection models. Lighting & reflection The Phong reflection model diffuse component ambient component specular component Topic 9: Lighting & Reflection models Lighting & reflection The Phong reflection model diffuse component ambient component specular component Spot the differences Terminology Illumination The transport

More information

CSCI 4620/8626. Computer Graphics Illumination Models and Surface Rendering Methods (Chapter 17)

CSCI 4620/8626. Computer Graphics Illumination Models and Surface Rendering Methods (Chapter 17) CSCI 4620/8626 Computer Graphics Illumination Models and Surface Rendering Methods (Chapter 17) Last update: 2016-04-19 Realism! Realistic displays of a scene use! Perspective projections of objects! Application

More information

9. Illumination and Shading

9. Illumination and Shading 9. Illumination and Shading Approaches for visual realism: - Remove hidden surfaces - Shade visible surfaces and reproduce shadows - Reproduce surface properties Texture Degree of transparency Roughness,

More information

CSE 167: Introduction to Computer Graphics Lecture #7: Lights. Jürgen P. Schulze, Ph.D. University of California, San Diego Spring Quarter 2015

CSE 167: Introduction to Computer Graphics Lecture #7: Lights. Jürgen P. Schulze, Ph.D. University of California, San Diego Spring Quarter 2015 CSE 167: Introduction to Computer Graphics Lecture #7: Lights Jürgen P. Schulze, Ph.D. University of California, San Diego Spring Quarter 2015 Announcements Thursday in-class: Midterm Can include material

More information

Shading. Brian Curless CSE 557 Autumn 2017

Shading. Brian Curless CSE 557 Autumn 2017 Shading Brian Curless CSE 557 Autumn 2017 1 Reading Optional: Angel and Shreiner: chapter 5. Marschner and Shirley: chapter 10, chapter 17. Further reading: OpenGL red book, chapter 5. 2 Basic 3D graphics

More information