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

Size: px
Start display at page:

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

Transcription

1 Illumination and Shading Illumination (ighting) Model the interaction of light with surface oints to determine their final color and brightness OenG comutes illumination at vertices illumination Shading Aly the lighting model at a set of oints across the entire surface Shading Illumination Model The governing rinciles for comuting the illumination A illumination model usually considers: ight attributes (light intensity, color, osition, direction, shae) Object surface attributes (color, reflectivity, transarency, etc) Interaction among lights and objects (object orientation) Interaction between objects and eye (viewing dir.)

2 Illumination Calculation Illumination Models ocal illumination: only consider the light, the observer osition, and the object material roerties Global illumination: take into account the interaction of light from all the surfaces in the scene object 4 θ object 3 object 2 object 1 Examle: OenG Examle: Ray Tracing (CIS681) Basic ight Tyes Directional So far away so that light rays are Remember orthogonal rojection? sun Directional light ight Source Tyes Point ight emanates equally in all directions Sot Point source limited to an angle Sot light Point light from Akenine-Moller & Haines

3 Object Proerties What haens when light hits an object? Proerties of light reflection on an object s surface Reflectance Models Ambient Diffuse Secular Absortion, Emission, Transarency/Translucency Irradiance: All light that arrives at a oint on the surface Radiosity: ight leaving a surface in all directions Object Proerties Object Material Shiny (Metal), dull (Matte finish), mirror-like, glass, neon, etc. ocal vs. Global Illumination Simle local illumination ocal Illumination deends on local object & light sources only Global Illumination at a oint can deend on any other oint in the scene The model used by OenG considers three tyes of light contribution to comute the final illumination of an object Ambient Diffuse Secular Final illumination of a oint (vertex) = ambient + diffuse + secular

4 Ambient lighting examle Diffuse lighting examle Secular light examle ight Reflectance Comonents Take a oint P on the object surface: R R θ θ θ θ φ V : ight Vector R: Reflection Vector Reflects about the ormal () to the surface V: View Vector

5 Ambient Reflection Background light scattered by the environment ight bounces off of many objects Simle Global Illumination Simle reflectance model Indeendent of ight osition Object orientation Viewer s osition k a : Ambient reflection coefficient Ambient light an object reflects 0 k a 1 Ambient = I a * k a Diffuse Reflection ambert s aw: Radiant energy D that a small surface atch receives from a light source: D = I d * cos(θ) I d = light intensity, θ = Angle between and Also called ambertian or Matte surfaces ambert s aw (1) ambert s aw (2) How does D change if the light source moves? Max intensity How does D change on an object s surface? A shere s surface has all ossible normal directions θ, D = I d * cos(θ) o intensity

6 Diffuse Reflection Energy D is reflected equally in all directions on the surface Indeendent of Viewer s osition k d : Diffuse reflection coefficient Diffuse light an object reflects 0 k d 1 Secular Reflection (1) The reflection of the light source on the object Shiny/Glossy surfaces ot a erfect mirror Show u as Secular Highlights, i.e., bright sots Diffuse = I d * k d * cos(θ) = I d * k d * ( ) and must be normalized WHY??? Secular Reflection (2) The object reflects maximum light intensity in the direction of the reflection vector θ θ φ R V ight intensity increases as V gets closer to R V R = cos(φ) Secular obe The reflection of the light source is maximum at the reflection direction Falls off quickly as the viewer moves away The size of the lobe determines the shininess of the object The shinier the object the smaller the lobe (cos(φ)) shine

7 Secular Reflection k s : Secular reflection coefficient Secular light an object reflects 0 k s 1 Ambient/Diffuse/Secular Just ambient light: Diffuse and change Ambient I s φ n : surface normal at P : light intensity : angle between V and R : shininess factor R θ θ φ V Sec = I s * k s * cos n (φ) = I s * k s * (V R) n V and R must be unit vectors WHY??? eft: Shere with just diffuse reflection Right:Shere with just secular reflection Basic Reflectance Equation Reflectance = from Akenine-Moller & Haines Ambient Diffuse Secular Final = I a * k a + I d * k d * ( ) + I s * k s * (R V) n Put it all together Illumination from a single light source: Illum = ambient + diffuse + secular = Ka x I + Kd x I x max(0, ) + Ks x I x max(0,r V) n ote that the K s and the I s are vectors (RGB).

8 Put it all together If there are lights Total illumination for a oint P = Σ (Illum) Some more terms to be added (in OenG): Self emission Global ambient ight distance attenuation and sot light effect ighting in OenG Adot Phong lighting model (secular) lus diffuse and ambient lights ighting is comuted at vertices Interolate across surface (Gouraud/smooth shading) OR Use a constant illumination (get it from one of the vertices) Setting u OenG ighting: ight Proerties Enable/Disable lighting Surface material roerties Provide correct surface normals ight model roerties ight Proerties Proerty Examle Proerties: Colors / Position and tye / attenuation glightfv(light, roerty, value) (1) constant: secify which light you want to set the roerty examle: G_IGHT0, G_IGHT1, G_IGHT2 you can create multile lights (OenG allows at least 8 lights) (2) constant: secify which light roerty you want to set the value examle: G_AMBIET, G_DIFFUSE, G_SPECUAR, G_POSITIO (check the red book for more) (3) The value you want to set to the roerty Define colors and osition a light Gfloat light_ambient[] = {0.0, 0.0, 0.0, 1.0}; Gfloat light_diffuse[] = {1.0, 1.0, 1.0, 1.0}; Gfloat light_secular[] = {1.0, 1.0, 1.0, 1.0}; Gfloat light_osition[] = {0.0, 0.0, 1.0, 1.0}; glightfv(g_ight0, G_AMBIET, light_ambient); glightfv(g_ight0, G_DIFFUSE, light_diffuse); glightfv(g_ight0, G_SPECUAR, light_secular); glightfv(g_ight0, G_POSITIO, light_osition); colors Position What if I set the Position to (0,0,1,0)?

9 Tyes of lights Turning on the lights OenG suorts two tyes of lights ocal light (oint light) Infinite light (directional light) Determined by the light ositions you rovide w = 0: infinite light source (faster) w!= 0: oint light osition = (x/w, y/w, z/w) Gfloat light_osition[] = {x,y,z,w}; Turn on the ower (for all the lights) glenable(g_ightig); gldisable(g_ightig); Fli each light s switch glenable(g_ightn) (n = 0,1,2, ) glightfv(g_ight0, G_POSITIO, light_osition); Controlling light osition Modelview matrix affects a light s osition You can secify the osition relative to: Eye sace: the highlight remains in the same osition relative to the eye call glightfv() before gluookat() World sace: a light s osition/direction aears fixed in the scene Call glightfv() after gluookat() Any model sace (not as intuitive). See ate Robin s Demo Material Proerties The color and surface roerties of a material (dull, shiny, etc.) How much the surface reflects the incident lights (ambient/diffuse/secular reflection coefficients) glmaterialfv(face, roerty, value) Face: material roerty for which face (e.g. G_FROT, G_BACK, G_FROT_AD_BACK) Proerty: what material roerty you want to set (e.g. G_AMBIET, G_DIFFUSE, G_SPECUAR, G_SHIIESS, G_EMISSIO, etc) Value: the value you can to assign to the roerty

10 Material Examle Define ambient/diffuse/secular reflection and shininess Gfloat mat_amb_diff[] = {1.0, 0.5, 0.8, 1.0}; refl. coefficient Gfloat mat_secular[] = {1.0, 1.0, 1.0, 1.0}; Gfloat shininess[] = {5.0}; (range: dull 0 very shiny128) glmaterialfv(g_frot_ad_back, G_AMBIET_AD_DIFFUSE, mat_amb_diff); glmaterialfv(g_frot, G_SPECUAR, mat_secular); glmaterialfv(g_frot, G_SHIIESS, shininess); Global light roerties glightmodelfv(roerty, value) Enable two-sided lighting roerty = G_IGHT_MODE_TWO_SIDE value = G_TRUE (G_FASE if you don t want two sided lighting) Global ambient color Proerty = G_IGHT_MODE_AMBIET Value = (red, green, blue, 1.0); Check the red book for others Surface ormals Correct normals are essential for correct lighting Associate a normal to each vertex glbegin( ) glormal3f(x,y,z) glvertex3f(x,y,z) glend() The normals you rovide need to have a unit length You can use glenable(g_ormaize) to have OenG normalize all the normals. Why not always have OenG do this? ighting revisit Where is lighting erformed in the grahics ieline? v1, m1 v2, m2 v3, m3 Rasterization texturing shading modeling and viewing viewort maing er vertex lighting interolate vertex colors rojection cliing Dislay

11 Polygon shading model Flat shading comute lighting once and assign the color to the whole olygon Flat shading Only use one vertex (usually the first one) normal and material roerty to comute the color for the olygon Benefit: fast to comute It is used when: The olygon is small enough The light source is far away (why?) The eye is very far away (why?) OenG command: glshademodel(g_fat) Smooth shading Remove edge discontinuity Comute lighting for more oints on each face Still has a mach-band erceived discontinuity due to your eye s edge detection. Smooth shading Two oular methods: Smooth shading (used by OenG) Per-fragment lighting (better secular highlight, requires rogrammable shaders in OenG) Flat shading smooth shading

12 Smooth Shading The smooth shading algorithm used in OenG glshademodel(g_smooth) ighting is calculated for each of the olygon vertices Colors are interolated for interior ixels Smooth Shading Per-vertex lighting calculation ormal is needed for each vertex Per-vertex normals can be comuted by averaging the adjacent face normals n1 n3 n n4 n2 n = (n1 + n2 + n3 + n4) / 4.0 Smooth Shading Smooth Shading Comute vertex illumination (color) before the rojection transformation Shade interior ixels: color interolation (normals are not needed) C2 C1 Ca = ler(c1, C2) Cb = ler(c1, C3) C3 er(ca, Cb) for all scanlines * ler: linear interolation inear interolation v1 a x b v2 x = a / (a+b) * v2 + b/(a+b) * v1 Interolate triangle color: use y distance to interolate the two end oints in the scanline, and use x distance to interolate interior ixel colors

13 Smooth Shading Problem ighting in the olygon interior can be inaccurate Smooth Shading Problem ighting in the olygon interior can be inaccurate Phong Shading Instead of interolation, we calculate lighting for each ixel inside the olygon (er ixel lighting) We need to have normals for all the ixels not rovided by the user Phong shading algorithm interolates the normals and comute lighting during rasterization (need to ma the normal back to world or eye sace though) Phong Shading (2) ormal interolation na = ler(n1, n2) ler(na, nb) n2 n3 n1 nb = ler(n1, n3) Slow! You will do this in the ray-tracing class.

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

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

Shading Models. Simulate physical phenomena

Shading Models. Simulate physical phenomena Illumination Models & Shading Shading Models Simulate hysical henomena Real illumination simulation is comlicated & exensive Use aroximation and heuristics with little hysical basis that looks surrisingly

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

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

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

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

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

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

521493S Computer Graphics Exercise 3 (Chapters 6-8)

521493S Computer Graphics Exercise 3 (Chapters 6-8) 521493S Comuter Grahics Exercise 3 (Chaters 6-8) 1 Most grahics systems and APIs use the simle lighting and reflection models that we introduced for olygon rendering Describe the ways in which each of

More information

CS770/870 Spring 2017 Color and Shading

CS770/870 Spring 2017 Color and Shading Preview CS770/870 Spring 2017 Color and Shading Related material Cunningham: Ch 5 Hill and Kelley: Ch. 8 Angel 5e: 6.1-6.8 Angel 6e: 5.1-5.5 Making the scene more realistic Color models representing the

More information

11/2/2010. In the last lecture. Monte-Carlo Ray Tracing : Path Tracing. Today. Shadow ray towards the light at each vertex. Path Tracing : algorithm

11/2/2010. In the last lecture. Monte-Carlo Ray Tracing : Path Tracing. Today. Shadow ray towards the light at each vertex. Path Tracing : algorithm Comuter Grahics Global Illumination: Monte-Carlo Ray Tracing and Photon Maing Lecture 11 In the last lecture We did ray tracing and radiosity Ray tracing is good to render secular objects but cannot handle

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

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

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

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

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

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

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

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

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

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

CS 428: Fall Introduction to. Geometric Transformations. Andrew Nealen, Rutgers, /15/2010 1

CS 428: Fall Introduction to. Geometric Transformations. Andrew Nealen, Rutgers, /15/2010 1 CS 428: Fall 21 Introduction to Comuter Grahics Geometric Transformations Andrew Nealen, Rutgers, 21 9/15/21 1 Toic overview Image formation and OenGL (last week) Modeling the image formation rocess OenGL

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

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

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

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

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

Lighting and Shading Computer Graphics I Lecture 7. Light Sources Phong Illumination Model Normal Vectors [Angel, Ch

Lighting and Shading Computer Graphics I Lecture 7. Light Sources Phong Illumination Model Normal Vectors [Angel, Ch 15-462 Computer Graphics I Lecture 7 Lighting and Shading February 12, 2002 Frank Pfenning Carnegie Mellon University http://www.cs.cmu.edu/~fp/courses/graphics/ Light Sources Phong Illumination Model

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

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

Ø Sampling Theory" Ø Fourier Analysis Ø Anti-aliasing Ø Supersampling Strategies" Ø The Hall illumination model. Ø Original ray tracing paper

Ø Sampling Theory Ø Fourier Analysis Ø Anti-aliasing Ø Supersampling Strategies Ø The Hall illumination model. Ø Original ray tracing paper CS 431/636 Advanced Rendering Techniques Ø Dr. David Breen Ø Korman 105D Ø Wednesday 6PM 8:50PM Presentation 6 5/16/12 Questions from ast Time? Ø Sampling Theory" Ø Fourier Analysis Ø Anti-aliasing Ø Supersampling

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

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

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

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

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

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

CPSC / Illumination and Shading

CPSC / Illumination and Shading CPSC 599.64 / 601.64 Rendering Pipeline usually in one step modelling of geometry transformation into world coordinate system placement of cameras and light sources transformation into camera coordinate

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

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

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

University of Victoria CSC 305 Shading. Brian Wyvill 2016

University of Victoria CSC 305 Shading. Brian Wyvill 2016 University of Victoria CSC 305 Shading Brian Wyvill 2016 The illuminating Hemisphere Energy and Intensity Energy is the intensity integrated over the solid angle through which it acts. Intensity is not

More information

Illumination. Michael Kazhdan ( /657) HB Ch. 14.1, 14.2 FvDFH 16.1, 16.2

Illumination. Michael Kazhdan ( /657) HB Ch. 14.1, 14.2 FvDFH 16.1, 16.2 Illumination Michael Kazhdan (601.457/657) HB Ch. 14.1, 14.2 FvDFH 16.1, 16.2 Ray Casting Image RayCast(Camera camera, Scene scene, int width, int height) { Image image = new Image(width, height); for

More information

Computer Graphics. Illumination and Shading

Computer Graphics. Illumination and Shading Rendering Pipeline modelling of geometry transformation into world coordinates placement of cameras and light sources transformation into camera coordinates backface culling projection clipping w.r.t.

More information

Shading. Shading = find color values at pixels of screen (when rendering a virtual 3D scene).

Shading. Shading = find color values at pixels of screen (when rendering a virtual 3D scene). Light Shading Shading Shading = find color values at pixels of screen (when rendering a virtual 3D scene). Shading Shading = find color values at pixels of screen (when rendering a virtual 3D scene). Same

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

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

CS 5625 Lec 2: Shading Models

CS 5625 Lec 2: Shading Models CS 5625 Lec 2: Shading Models Kavita Bala Spring 2013 Shading Models Chapter 7 Next few weeks Textures Graphics Pipeline Light Emission To compute images What are the light sources? Light Propagation Fog/Clear?

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

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

Perception of Shape from Shading

Perception of Shape from Shading 1 Percetion of Shae from Shading Continuous image brightness variation due to shae variations is called shading Our ercetion of shae deends on shading Circular region on left is erceived as a flat disk

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

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

Global Illumination with Photon Map Compensation

Global Illumination with Photon Map Compensation Institut für Comutergrahik und Algorithmen Technische Universität Wien Karlslatz 13/186/2 A-1040 Wien AUSTRIA Tel: +43 (1) 58801-18688 Fax: +43 (1) 58801-18698 Institute of Comuter Grahics and Algorithms

More information

CENG 477 Introduction to Computer Graphics. Ray Tracing: Shading

CENG 477 Introduction to Computer Graphics. Ray Tracing: Shading CENG 477 Introduction to Computer Graphics Ray Tracing: Shading Last Week Until now we learned: How to create the primary rays from the given camera and image plane parameters How to intersect these rays

More information

Recollection. Models Pixels. Model transformation Viewport transformation Clipping Rasterization Texturing + Lights & shadows

Recollection. Models Pixels. Model transformation Viewport transformation Clipping Rasterization Texturing + Lights & shadows Recollection Models Pixels Model transformation Viewport transformation Clipping Rasterization Texturing + Lights & shadows Can be computed in different stages 1 So far we came to Geometry model 3 Surface

More information

-=Bui Tuong Phong's Lighting=- University of Utah, but with shaders. Anton Gerdelan Trinity College Dublin

-=Bui Tuong Phong's Lighting=- University of Utah, but with shaders. Anton Gerdelan Trinity College Dublin -=Bui Tuong Phong's Lighting=- University of Utah, 1973 but with shaders Anton Gerdelan Trinity College Dublin Before we do anything - normals Q. What does a normal do? Q. How do we usually calculate them?

More information

Models and Architectures

Models and Architectures Models and Architectures Objectives Learn the basic design of a graphics system Introduce graphics pipeline architecture Examine software components for an interactive graphics system 1 Image Formation

More information

Texture Mapping with Vector Graphics: A Nested Mipmapping Solution

Texture Mapping with Vector Graphics: A Nested Mipmapping Solution Texture Maing with Vector Grahics: A Nested Mimaing Solution Wei Zhang Yonggao Yang Song Xing Det. of Comuter Science Det. of Comuter Science Det. of Information Systems Prairie View A&M University Prairie

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

Phong Lighting & Materials. Some slides modified from: David Kabala Others from: Andries Van Damm, Brown Univ.

Phong Lighting & Materials. Some slides modified from: David Kabala Others from: Andries Van Damm, Brown Univ. Phong Lighting & Materials Some slides modified from: David Kabala Others from: Andries Van Damm, Brown Univ. Lighting and Shading Lighting, or illumination, is the process of computing the intensity and

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

Assigning colour to pixels or fragments. Modelling Illumination. We shall see how it is done in a rasterization model. CS475/CS675 - Lecture 14

Assigning colour to pixels or fragments. Modelling Illumination. We shall see how it is done in a rasterization model. CS475/CS675 - Lecture 14 - Computer Graphics Assigig colour to pixels or fragmets. Modellig Illumiatio Illumiatio Model : The Phog Model For a sigle light source total illumiatio at ay poit is give by: ecture 14: I =k a I a k

More information

Turn on the Lights: Reflectance

Turn on the Lights: Reflectance Turn on the Lights: Reflectance Part 2: Shading Tuesday, October 15 2012 Lecture #14 Goal of Shading Model simple light sources Point light sources Extended light sources Ambient lighting Model 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

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?

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? Ligh%ng and Shading Ligh%ng and Shading Is this a plate or a ball? What color should I set for each pixel? 1 Physical Reality As light hits the surface: Part is absorbed Part is reflected Visible light

More information

Introduction. Lighting model Light reflection model Local illumination model Reflectance model BRDF

Introduction. Lighting model Light reflection model Local illumination model Reflectance model BRDF Shading Introduction Affine transformations help us to place objects into a scene. Before creating images of these objects, we ll look at models for how light interacts with their surfaces. Such a model

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

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

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

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

Lighting Models. CS116B Chris Pollett Mar 21, 2004.

Lighting Models. CS116B Chris Pollett Mar 21, 2004. Lighting Models CS116B Chris Pollett Mar 21, 2004. Outline Overview Light Sources Surface Lighting Effect Basic Illumination Models Overview An illumination model (lighting model) is used to calculate

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

Computer Graphics (CS 4731) Lecture 18: Lighting, Shading and Materials (Part 3)

Computer Graphics (CS 4731) Lecture 18: Lighting, Shading and Materials (Part 3) Computer Graphics (CS 4731) Lecture 18: Lighting, Shading and Materials (Part 3) Prof Emmanuel Agu Computer Science Dept. Worcester Polytechnic Institute (WPI) Recall: Flat Shading compute lighting once

More information

CSE 681 Illumination and Phong Shading

CSE 681 Illumination and Phong Shading CSE 681 Illumination and Phong Shading Physics tells us What is Light? We don t see objects, we see light reflected off of objects Light is a particle and a wave The frequency of light What is Color? Our

More information

Given: scene specification (object positions, optical properties p of the surface, viewer position, viewing direction, )

Given: scene specification (object positions, optical properties p of the surface, viewer position, viewing direction, ) Illumination and Shading Illumination and Shading Given: scene specification (object positions, optical properties p of the surface, viewer position, viewing direction, ) Find: intensity for each pixel

More information

Illumination Models and Surface-Rendering Methods. Chapter 10

Illumination Models and Surface-Rendering Methods. Chapter 10 Illumination Models and Surface-Rendering Methods Chapter 10 Illumination and Surface- Rendering Given scene specifications object positions, optical properties of the surface, viewer position, viewing

More information

Lighting and Reflectance COS 426

Lighting and Reflectance COS 426 ighting and Reflectance COS 426 Ray Casting R2mage *RayCast(R3Scene *scene, int width, int height) { R2mage *image = new R2mage(width, height); for (int i = 0; i < width; i++) { for (int j = 0; j < height;

More information

Interactive Real-Time Raycasting

Interactive Real-Time Raycasting Interactive Real-Time Raycasting CS184 AS4 Due 2009-02-26 11:00pm We start our exploration of Rendering - the process of converting a high-level object-based description into a graphical image for display.

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

Computer Graphics. Shading. Page. Copyright Gotsman, Elber, Barequet, Karni, Sheffer Computer Science, Technion. The Physics

Computer Graphics. Shading. Page. Copyright Gotsman, Elber, Barequet, Karni, Sheffer Computer Science, Technion. The Physics Comuter Grahics Illumiatio Models & The Physics 2 Local vs. Global Illumiatio Models Examle Local model direct ad local iteractio of each object with the light. Ambiet Diffuse Global model: iteractios

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

Simple Lighting/Illumination Models

Simple Lighting/Illumination Models Simple Lighting/Illumination Models Scene rendered using direct lighting only Photograph Scene rendered using a physically-based global illumination model with manual tuning of colors (Frederic Drago and

More information

Photorealism: Ray Tracing

Photorealism: Ray Tracing Photorealism: Ray Tracing Reading Assignment: Chapter 13 Local vs. Global Illumination Local Illumination depends on local object and light sources only Global Illumination at a point can depend on any

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

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

Shading. Introduction to Computer Graphics Torsten Möller. Machiraju/Zhang/Möller/Fuhrmann

Shading. Introduction to Computer Graphics Torsten Möller. Machiraju/Zhang/Möller/Fuhrmann Shading Introduction to Computer Graphics Torsten Möller Machiraju/Zhang/Möller/Fuhrmann Reading Chapter 5.5 - Angel Chapter 6.3 - Hughes, van Dam, et al Machiraju/Zhang/Möller/Fuhrmann 2 Shading Illumination

More information

Shading. Brian Curless CSE 457 Spring 2017

Shading. Brian Curless CSE 457 Spring 2017 Shading Brian Curless CSE 457 Spring 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

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 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

Objectives. Introduce Phong model Introduce modified Phong model Consider computation of required vectors Discuss polygonal shading.

Objectives. Introduce Phong model Introduce modified Phong model Consider computation of required vectors Discuss polygonal shading. Shading II 1 Objectives Introduce Phong model Introduce modified Phong model Consider computation of required vectors Discuss polygonal shading Flat Smooth Gouraud 2 Phong Lighting Model A simple model

More information

Topic 12: Texture Mapping. Motivation Sources of texture Texture coordinates Bump mapping, mip-mapping & env mapping

Topic 12: Texture Mapping. Motivation Sources of texture Texture coordinates Bump mapping, mip-mapping & env mapping Topic 12: Texture Mapping Motivation Sources of texture Texture coordinates Bump mapping, mip-mapping & env mapping Texture sources: Photographs Texture sources: Procedural Texture sources: Solid textures

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

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

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

Raytracing CS148 AS3. Due :59pm PDT

Raytracing CS148 AS3. Due :59pm PDT Raytracing CS148 AS3 Due 2010-07-25 11:59pm PDT We start our exploration of Rendering - the process of converting a high-level object-based description of scene into an image. We will do this by building

More information

Topic 11: Texture Mapping 11/13/2017. Texture sources: Solid textures. Texture sources: Synthesized

Topic 11: Texture Mapping 11/13/2017. Texture sources: Solid textures. Texture sources: Synthesized Topic 11: Texture Mapping Motivation Sources of texture Texture coordinates Bump mapping, mip mapping & env mapping Texture sources: Photographs Texture sources: Procedural Texture sources: Solid textures

More information