1 91.427 Computer Graphics I, Fall 2010 Shading II.

Slides:



Advertisements
Similar presentations
Computer Graphics - Shading -
Advertisements

Computer Graphics Shading Lecture 13 John Shearer
1 Graphics CSCI 343, Fall 2013 Lecture 18 Lighting and Shading.
CAP 4703 Computer Graphic Methods Prof. Roy Levow Chapter 6.
CS 480/680 Computer Graphics Shading 2 Dr. Frederick C Harris, Jr.
Virtual Realism LIGHTING AND SHADING. Lighting & Shading Approximate physical reality Ray tracing: Follow light rays through a scene Accurate, but expensive.
1 Computer Graphics By : Mohammed abu Lamdy ITGD3107 University of Palestine Supervision: Assistant Professor Dr. Sana’a Wafa Al-Sayegh.
1. What is Lighting? 2 Example 1. Find the cubic polynomial or that passes through the four points and satisfies 1.As a photon Metal Insulator.
Based on slides created by Edward Angel
1 Angel: Interactive Computer Graphics 5E © Addison-Wesley 2009 Shading I.
University of New Mexico
Computer Graphics - Class 10
Shading II CS4395: Computer Graphics 1 Mohan Sridharan Based on slides created by Edward Angel.
Lighting and Shading Wen-Chieh (Steve) Lin
1 CSCE 641: Computer Graphics Lighting Jinxiang Chai.
Objectives Learn to shade objects so their images appear three- dimensional Learn to shade objects so their images appear three- dimensional Introduce.
1 Angel: Interactive Computer Graphics 4E © Addison-Wesley 2006 Shading II Ed Angel Professor of Computer Science, Electrical and Computer Engineering,
CS5500 Computer Graphics March 26, Shading Reference: Ed Angel’s book.
1 Angel: Interactive Computer Graphics 4E © Addison-Wesley 2005 Shading I Ed Angel Professor of Computer Science, Electrical and Computer Engineering,
LIGHTING Part One - Theory based on Chapter 6. Lights in the real world Lights bounce off surfaces and reflect colors, scattering light in many directions.
Shading Surface can either (both) 1.Emit light. E.g. light bult 2.Reflect light. E.g. Mirror.
CS 480/680 Computer Graphics Shading I Dr. Frederick C Harris, Jr.
Illumination.
CS 445 / 645: Introductory Computer Graphics
1 Introduction to Computer Graphics with WebGL Ed Angel Professor Emeritus of Computer Science Founding Director, Arts, Research, Technology and Science.
1 Shading I Shandong University Software College Instructor: Zhou Yuanfeng
1 Angel: Interactive Computer Graphics 4E © Addison-Wesley 2005 Chapter 6: Shading Ed Angel Professor of Computer Science, Electrical and Computer Engineering,
Illumination & Reflectance Dr. Amy Zhang. Outline 2  Illumination and Reflectance  The Phong Reflectance Model  Shading in OpenGL.
1 Chapter 6 Shading. 2 Objectives Learn to shade objects so their images appear three-dimensional Introduce the types of light-material interactions Build.
Chi-Cheng Lin, Winona State University CS430 Computer Graphics Lighting and Shading.
Copyright  1999 by James H. Money. All rights reserved. Except as permitted under United States Copyright Act of 1976, no part of this publication may.
Game Object Appearance. The Three Faces of Designing GO Appearance The Artistic Face: ◦ aesthetic – beautiful and ugly ◦ done by artists The Communication.
CSC418 Computer Graphics n Illumination n Lights n Lightinging models.
Computer Graphics I, Fall 2010 Shading in OpenGL.
Rendering Overview CSE 3541 Matt Boggus. Rendering Algorithmically generating a 2D image from 3D models Raster graphics.
University of Texas at Austin CS 378 – Game Technology Don Fussell CS 378: Computer Game Technology Basic Rendering Pipeline and Shading Spring 2012.
1 Angel: Interactive Computer Graphics 4E © Addison-Wesley 2005 Shading I Ed Angel Professor of Computer Science, Electrical and Computer Engineering,
Illumination.
1 Introduction to Computer Graphics with WebGL Ed Angel Professor Emeritus of Computer Science Founding Director, Arts, Research, Technology and Science.
11/04/04© University of Wisconsin, CS559 Fall 2004 Last Time Visibility –Z-Buffer and transparency –A-buffer –Area subdivision –BSP Trees –Exact Cell-Portal.
Illumination and Shading
1 Introduction to Computer Graphics with WebGL Ed Angel Professor Emeritus of Computer Science Founding Director, Arts, Research, Technology and Science.
Shading in OpenGL Ed Angel Professor Emeritus of Computer Science University of New Mexico 1 E. Angel and D. Shreiner: Interactive Computer Graphics 6E.
RENDERING Introduction to Shading models – Flat and Smooth shading – Adding texture to faces – Adding shadows of objects – Building a camera in a program.
Introduction to Computer Graphics with WebGL
Shading. For Further Reading Angel 7 th Ed: ­Chapter 6 2.
Specular Reflection Lecture 27 Mon, Nov 10, 2003.
Local Illumination and Shading
1 CSCE 441: Computer Graphics Lighting Jinxiang Chai.
OpenGL Shading. 2 Objectives Learn to shade objects so their images appear three-dimensional Introduce the types of light-material interactions Build.
Lighting and Reflection Angel Angel: Interactive Computer Graphics5E © Addison-Wesley
1 CSCE 441: Computer Graphics Lighting Jinxiang Chai.
David Luebke3/16/2016 CS 551 / 645: Introductory Computer Graphics David Luebke
Computer Graphics Lecture 25 Fasih ur Rehman. Last Class Shading.
Computer Graphics Lecture 30 Mathematics of Lighting and Shading - IV Taqdees A. Siddiqi
1 CSCE 441: Computer Graphics Lighting Jinxiang Chai.
Computer Graphics Ken-Yi Lee National Taiwan University (the slides are adapted from Bing-Yi Chen and Yung-Yu Chuang)
Computer Graphics: Illumination
C O M P U T E R G R A P H I C S Guoying Zhao 1 / 55 C O M P U T E R G R A P H I C S Guoying Zhao 1 / 55 Computer Graphics Three-Dimensional Graphics V.
Shading To determine the correct shades of color on the surface of graphical objects.
Shading II Ed Angel Professor of Computer Science, Electrical and Computer Engineering, and Media Arts University of New Mexico Angel: Interactive Computer.
Rendering Curves and Surfaces
Vectors, Normals, & Shading
CSE 470 Introduction to Computer Graphics Arizona State University
CS5500 Computer Graphics April 10, 2006.
Isaac Gang University of Mary Hardin-Baylor
Simple Illumination CSE 681.
CS 480/680 Computer Graphics Shading.
Lighting Calculations
Shading II Ed Angel Professor Emeritus of Computer Science
Presentation transcript:

Computer Graphics I, Fall 2010 Shading II

Computer Graphics I, Fall 2010 Objectives Continue discussion of shading Introduce modified Phong model Consider computation of required vectors

Computer Graphics I, Fall 2010 Ambient Light Ambient light = result of multiple interactions between (large) light sources and objects in environment Amount and color depend on both color of light(s) and material properties of object Add k a I a to diffuse and specular terms reflection coef intensity of ambient light

Computer Graphics I, Fall 2010 Distance Terms Light from point source that reaches surface inversely proportional to square of distance between them Can add factor f att = 1/(c 1 + c 2 d + c 3 d 2 ) to diffuse and specular terms Constant and linear terms soften effect of point source Usually clamp to 1 (take min)

Computer Graphics I, Fall 2010 Light Sources In Phong Model, add results from each light source Each light source has separate d iffuse, s pecular, and a mbient terms ==> allow max flexibility ­even though no physical justification Separate R, G, B components ==> 9 coefficients for each point source ­I dr, I dg, I db, I sr, I sg, I sb, I ar, I ag, I ab

Computer Graphics I, Fall 2010 Material Properties Material properties match light source properties ­Nine absorption coefficients k dr, k dg, k db, k sr, k sg, k sb, k ar, k ag, k ab ­Shininess coefficient 

Computer Graphics I, Fall 2010 Adding up the Components For each light source and each color component, Phong model can be written (without distance terms) as I = k d I d l · n + k s I s ( v · r )  + k a I a For each color component add contributions from all sources

Computer Graphics I, Fall 2010 Modified Phong Model Specular term in Phong model problematic requires for ea. vertex, calculation of new reflection vector view vector Blinn suggested approximation using halfway vector more efficient

Computer Graphics I, Fall 2010 The Halfway Vector h = normalized vector halfway between l and v h = ( l + v )/ | l + v |

Computer Graphics I, Fall 2010 Using the halfway vector Replace ( v · r )  by ( n · h )   chosen to match shininess Note that halfway angle = half of angle between r and v if vectors are coplanar Resulting model known as “modified Phong” or “Blinn lighting model” ­Specified in OpenGL standard

Computer Graphics I, Fall 2010 Example Only differences in these teapots are parameters in modified Phong model

Computer Graphics I, Fall 2010 Computation of Vectors l and v specified by application Can compute r from l and n Problem is determining n For simple surfaces can be determined But how determine n differs Depending on underlying rep’n of surface OpenGL leaves determination of normal to application ­Exception for GLU quadrics and Bezier surfaces (Chapter 11)

Computer Graphics I, Fall 2010 Plane Normals Equation of plane: ax + by + cz + d = 0 From Chapter 4 know that plane determined by three points p 0, p 1, p 2 or normal n and p 0 Normal can be obtained by n = (p 2 - p 0 ) × (p 1 - p 0 )

Computer Graphics I, Fall 2010 Computing the cross-product v = [v 1, v 2, v 3 ] T w = [w 1, w 2, w 3 ] T v  w = det Replace i, j, k with e 1, e 2, e 3 ==> ==>

Computer Graphics I, Fall 2010 Normal to Sphere Implicit function f(x, y, z) = 0 Normal given by gradient Sphere f(p) = p · p - 1 n = [ ∂ f/ ∂ x, ∂ f /∂ y, ∂ f/ ∂ z] T = p

Computer Graphics I, Fall 2010 Parametric Form For sphere Tangent plane determined by vectors Normal given by cross product x = x(u,v) = cos u sin v y = y(u,v) = cos u cos v z = z(u,v) = sin u ∂p/∂u = [∂x/∂u, ∂y/∂u, ∂z/∂u] T ∂p/∂v = [∂x/∂v, ∂y/∂v, ∂z/∂v] T n = ∂p/∂u × ∂p/∂v

Computer Graphics I, Fall 2010 General Case Can compute parametric normals for other simple cases ­Quadrics ­Parameteric polynomial surfaces Bezier surface patches (Chapter 11)