Computer Graphics Inf4/MSc Computer Graphics Lecture 13 Illumination I – Local Models.

Slides:



Advertisements
Similar presentations
GR2 Advanced Computer Graphics AGR
Advertisements

SI23 Introduction to Computer Graphics
16.1 Si23_03 SI23 Introduction to Computer Graphics Lecture 16 – Some Special Rendering Effects.
7.1 si31_2001 SI31 Advanced Computer Graphics AGR Lecture 7 Polygon Shading Techniques.
Lecture 14 Illumination II – Global Models
Computer Graphics Bing-Yu Chen National Taiwan University.
CSPC 352: Computer Graphics
Virtual Realism LIGHTING AND SHADING. Lighting & Shading Approximate physical reality Ray tracing: Follow light rays through a scene Accurate, but expensive.
Illumination and Shading
University of British Columbia CPSC 314 Computer Graphics Jan-Apr 2008 Tamara Munzner Lighting/Shading III Week.
IMGD 1001: Illumination by Mark Claypool
Computer Graphics (Fall 2005) COMS 4160, Lecture 16: Illumination and Shading 1
Lighting and Shading Wen-Chieh (Steve) Lin
(conventional Cartesian reference system)
7M836 Animation & Rendering
Objectives Learn to shade objects so their images appear three- dimensional Learn to shade objects so their images appear three- dimensional Introduce.
CS 376 Introduction to Computer Graphics 03 / 30 / 2007 Instructor: Michael Eckmann.
CS248 Final Review Derek Chan and Abe Davis. CS248 Final Monday, December 8, 3:30 to 6:30 pm Closed book, closed notes Mainly from material in the second.
6.1 Vis_04 Data Visualization Lecture 6 - A Rough Guide to Rendering.
©Larry F. Hodges (modified by Amos Johnson) 1 Shading Models.
Coordinate Systems X Y Z (conventional Cartesian reference system) X Y Z.
University of British Columbia CPSC 414 Computer Graphics © Tamara Munzner 1 Shading Week 5, Wed 1 Oct 2003 recap: lighting shading.
Part I: Basics of Computer Graphics Rendering Polygonal Objects (Read Chapter 1 of Advanced Animation and Rendering Techniques) Chapter
University of British Columbia CPSC 314 Computer Graphics Jan-Apr 2005 Tamara Munzner Lighting and Shading Week.
Computer Graphics Inf4/MSc Computer Graphics Lecture 11 Texture Mapping.
Introduction to 3D Graphics Lecture 6: Real-Time Rendering Anthony Steed University College London.
CS 445 / 645: Introductory Computer Graphics
1 Computer Graphics Week13 –Shading Models. Shading Models Flat Shading Model: In this technique, each surface is assumed to have one normal vector (usually.
Computer Graphics Inf4/MSc Computer Graphics Lecture 9 Antialiasing, Texture Mapping.
3D Computer Graphics: Textures. Textures: texels Texture is a way of assigning a diffuse color to a pixel – can be with 1, 2 or 3D- can use maps, interpolation.
Polygon Shading. Assigning color to a shape to make graphical scenes look realistic, or artistic, or whatever effect we’re attempting to achieve But first.
CS 445 / 645 Introduction to Computer Graphics Lecture 18 Shading Shading.
Shading (introduction to rendering). Rendering  We know how to specify the geometry but how is the color calculated.
University of Illinois at Chicago Electronic Visualization Laboratory (EVL) CS 426 Intro to 3D Computer Graphics © 2003, 2004, 2005 Jason Leigh Electronic.
COMPUTER GRAPHICS CS 482 – FALL 2014 AUGUST 27, 2014 FIXED-FUNCTION 3D GRAPHICS MESH SPECIFICATION LIGHTING SPECIFICATION REFLECTION SHADING HIERARCHICAL.
Technology and Historical Overview. Introduction to 3d Computer Graphics  3D computer graphics is the science, study, and method of projecting a mathematical.
1 Texture Mapping ©Anthony Steed Overview n Texture mapping Inverse and Forward Mapping Bilinear interpolation Perspective correction n Mipmapping.
1 SIC / CoC / Georgia Tech MAGIC Lab Rossignac Textures and shadows  Generation  Mipmap  Texture coordinates,
COLLEGE OF ENGINEERING UNIVERSITY OF PORTO COMPUTER GRAPHICS AND INTERFACES / GRAPHICS SYSTEMS JGB / AAS 1 Shading (Shading) & Smooth Shading Graphics.
Computer Graphics An Introduction. What’s this course all about? 06/10/2015 Lecture 1 2 We will cover… Graphics programming and algorithms Graphics data.
Shading & Texture. Shading Flat Shading The process of assigning colors to pixels. Smooth Shading Gouraud ShadingPhong Shading Shading.
Rendering Overview CSE 3541 Matt Boggus. Rendering Algorithmically generating a 2D image from 3D models Raster graphics.
1 Texture Mapping. 2 Texture Aliasing MIPmaps Environment Mapping Bump Mapping Displacement Mapping Shadow Maps Solid Textures Antialiasing.
Taku KomuraComputer Graphics Local Illumination and Shading Computer Graphics – Lecture 10 Taku Komura Institute for Perception, Action.
Advanced Computer Graphics Advanced Shaders CO2409 Computer Graphics Week 16.
Steve Sterley. Real World Lighting Physical objects tend to interact with light in three ways: Absorption (black body) Reflection (mirror) Transmission.
CS418 Computer Graphics John C. Hart
Komputer Grafik 2 (AK045206) Shading 1/17 Realisme : Shading.
Illumination and Shading
CS 325 Introduction to Computer Graphics 03 / 29 / 2010 Instructor: Michael Eckmann.
CS 445 / 645 Introduction to Computer Graphics Lecture 15 Shading Shading.
Lecture 6 Rasterisation, Antialiasing, Texture Mapping,
Lecture Fall 2001 Illumination and Shading in OpenGL Light Sources Empirical Illumination Shading Transforming Normals Tong-Yee Lee.
11/5/2002 (c) University of Wisconsin, CS 559 Last Time Local Shading –Diffuse term –Specular term –All together –OpenGL brief overview.
Local Illumination and Shading
Lighting and Shading Part 2. Global Ambient Light There are at least 8 OpenGL lights and 1 Global Ambient Setting the Global Ambient globalAmbient[] =
Render methods. Contents Levels of rendering Wireframe Plain shadow Gouraud Phong Comparison Gouraud-Phong.
David Luebke3/16/2016 CS 551 / 645: Introductory Computer Graphics David Luebke
Illumination Models. Introduction 1 Illumination model: Given a point on a surface, what is the perceived color and intensity? Known as Lighting Model,
Computer Graphics Ken-Yi Lee National Taiwan University (the slides are adapted from Bing-Yi Chen and Yung-Yu Chuang)
Applications and Rendering pipeline
Computer Graphics (Fall 2006) COMS 4160, Lecture 16: Illumination and Shading 1
Illumination and Shading. Illumination (Lighting) Model the interaction of light with surface points to determine their final color and brightness OpenGL.
Chapter 14 Shading Models.
CSC461: Lecture 23 Shading Computation
Computer Graphics Material Colours and Lighting
Computer Graphics (Fall 2003)
Chapter 14 Shading Models.
Adding Surface Detail 고려대학교 컴퓨터 그래픽스 연구실.
Adding Surface Detail 고려대학교 컴퓨터 그래픽스 연구실.
Presentation transcript:

Computer Graphics Inf4/MSc Computer Graphics Lecture 13 Illumination I – Local Models

Computer Graphics Inf4/MSc 2/11/2007Lecture Notes #132 Illumination Models Illumination: transport of luminous flux from light sources via direct & indirect paths. Lighting: computing intensity reflected from 3D point in scene. Shading: assigning pixel colour. Illumination Models: - Empirical: simple approximations to observed phenomena. - Physically-based: model actual physics of light interactions.

Computer Graphics Inf4/MSc 2/11/2007Lecture Notes #133 Two Components of Illumination Light Sources: -Emittance spectrum (colour) -Geometry (position and colour) -Directional attenuation Surface Properties: -Reflectance spectrum (colour) -Geometry (position, orientation, and micro-structure) -Absorption Simplifications: - Use only direct illumination from emitters to reflectors - Ignore geometry of emitters, use only geometry of reflectors

Computer Graphics Inf4/MSc 2/11/2007Lecture Notes #134 Illumination model from last lecture AmbientDiffuse Specular

Computer Graphics Inf4/MSc 2/11/2007Lecture Notes #135 Phong model – the effect of n n=0.1 n=0.5 n=10 n=2 n=1

Computer Graphics Inf4/MSc 2/11/2007Lecture Notes #136 Phong examples

Computer Graphics Inf4/MSc 2/11/2007Lecture Notes #137 There may be a number of Point Sources Extend empirical model as: (and replacing cosines) This is known as the standard LOCAL ILUMINATION MODEL

Computer Graphics Inf4/MSc 2/11/2007Lecture Notes #138 Local Illumination Model Considers light sources and surface properties only. Approximations based on appearance. Fast real-time interactive rendering. Haven’t considered light attenuation – inverse square law – but don’t like exponentiation and doesn’t always look right.

Computer Graphics Inf4/MSc 2/11/2007Lecture Notes #139 Local Illumination Model Use 1/(s+k) where s relates to eye-object distance and k is some constant for scene. Can add transparency too, to give final empirical model as shown below: Note: must apply 3 times – for each primary.

Computer Graphics Inf4/MSc 2/11/2007Lecture Notes #1310 Shading Polyhedra Objects modelled as plane-faced polyhedra Assumptions: –Source at infinity constant. –Viewer at infinity constant. –Polygon is not an approximation – often incorrect and need smoother shading. If first two unacceptable, average. For specularity varies across surface.

Computer Graphics Inf4/MSc 2/11/2007Lecture Notes #1311 Shading Polyhedra Flat (facet) shading: –Works well for objects really made of flat faces. –Appearance depends on number of polygons for curved surface objects. If polyhedral model is an approximation then need to smooth.

Computer Graphics Inf4/MSc 2/11/2007Lecture Notes #1312 Mach banding. Physiological effect exaggerates difference between closely coloured polygons. -Mach banding. -Exaggerates intensity change at an edge with a discontinuity in magnitude. - Our eyes are well adapted to seeing edges ! - Using a finer mesh is surprisingly ineffective.

Computer Graphics Inf4/MSc 2/11/2007Lecture Notes #1313 Interpolated shading. Wylie, Romney, Evans and Erdahl pioneered linear interpolation of shading information from the vertices. Gouraud generalized this to arbitrary polygons. Interpolate illumination in same manner as we interpolated z for z-buffering. –Not physically correct for illumination. Assumption of polygon approximating a curved surface gives rise to largest error.

Computer Graphics Inf4/MSc 2/11/2007Lecture Notes #1314 Gouraud Shading. Find vertex normals by averaging face normals, or find analytically. - Use vertex normals with desired shading model, - Interpolate vertex intensities along edges. - Interpolate edge values across a scanline. I bc I ac A B C I ac interpolated A to C, I bc interpolated B to C.

Computer Graphics Inf4/MSc 2/11/2007Lecture Notes #1315 Gouraud shading

Computer Graphics Inf4/MSc 2/11/2007Lecture Notes #1316 Phong shading. Normals are calculated for each vertex. Vectors are interpolated across the face. Illumination calculated with interpolated normal vector, ie. shading model applied each step. Interpolated normals. Assume polygon is approximation to curved surface.

Computer Graphics Inf4/MSc 2/11/2007Lecture Notes #1317 Phong shading. In Phong model of specular reflection, highlight falls off with cos n  Gouraud shading linear interpolates – makes highlight too big. Gouraud shading may well miss a highlight that occurs in the middle of the face. Direction of maximum highlight

Computer Graphics Inf4/MSc 2/11/2007Lecture Notes #1318 Phong shading. In Phong model of specular reflection, highlight falls off with cos n  Gouraud shading linear interpolates – makes highlight too big. Gouraud shading may well miss a highlight that occurs in the middle of the face. Direction of maximum highlight Highlight on surface.

Computer Graphics Inf4/MSc 2/11/2007Lecture Notes #1319 Phong example

Computer Graphics Inf4/MSc 2/11/2007Lecture Notes #1320 Problems with interpolation shading. Problems with computing vertex normals. A,B are shared by all polygons, but C is not shared by the polygon on the left. -Shading information calculated to the right of C will be different from that to the left. - Shading discontinuity. Solution : introduce a ‘ghost’ vertex that shares C’s values A B C

Computer Graphics Inf4/MSc 2/11/2007Lecture Notes #1321 Problems with interpolation shading. Problems with computing vertex normals. Face surface normals and averaged vertex normals shown. Unrepresentative so add small polygon strips along edges or test angle and threshold to defeat averaging.

Computer Graphics Inf4/MSc 2/11/2007Lecture Notes #1322 Problems with interpolation shading. Perspective distortion. –Perform interpolation after perspective transformation. Must perform interpolation in image space. Could split polygon into lots of small triangles and it would look okay either way.

Computer Graphics Inf4/MSc 2/11/2007Lecture Notes #1323 Problems with interpolation shading. Rotational invariance? –The results of interpolation shading can change with orientation of the polygon. C A B C D A B D Point on left is interpolated between AD & AB, Point on right is interpolated between AB & BC

Computer Graphics Inf4/MSc 2/11/2007Lecture Notes #1324 Problems with interpolation shading. Solution. –Decompose polygon into triangles before Gouraud shading.

Computer Graphics Inf4/MSc 2/11/2007Lecture Notes #1325 Summary of shading. Constant shading –approximation only holds for exceptional cases. –appearance of Mach bands. Gouraud shading – poorly interpolates specular highlights. Phong shading – better, and better in animation too (less Mach banding). Problems with interpolation shading.

Computer Graphics Inf4/MSc 2/11/2007Lecture Notes #1326 Texture mapping. Method of improving surface appearance by adding details on surface.

Computer Graphics Inf4/MSc 2/11/2007Lecture Notes #1327 Texture mapping. Image is ‘pasted’ onto a polygon. Image is called a Texture map, it’s pixels are often referred as a Texels and have coordinates (u,v) Texture coordinates are defined for each vertex and interpolated across the polygon. v u v u y x

Computer Graphics Inf4/MSc 2/11/2007Lecture Notes #1328 Texture mapping = 2D image warp. v u v u y x 2D texture Space 3D Object space 3D World space 3D Camera space 2D Image Space Parameterisation Model Transformation Viewing Transformation Projection

Computer Graphics Inf4/MSc 2/11/2007Lecture Notes #1329 Polygonal Texture mapping. Texture to Screen transformation composed of 3 transformations : 1. Parameterization may be written as a linear transformation from texture space to object Space (TO) 2. Modelling and viewing transformation from object space to camera Space (OC) 3. Projection from camera space to screen space (CS) (not shown)

Computer Graphics Inf4/MSc 2/11/2007Lecture Notes #1330 Interpolation of texture coordinates. Same problem as for Gouraud shading – need to break down into triangles for rotational invariance. Linear interpolation leads to incorrect perspective. Linear interpolationPerspective interpolation ½ L

Computer Graphics Inf4/MSc 2/11/2007Lecture Notes #1331 Texture filtering. Can map texture in 2 ways : –From (u,v) space to (x,y) – forward mapping. –From (x,y) back to (u,v) – reverse mapping. Forward mapping is linear projective map. Reverse mapping is inverse – also linear projective map. –The inverse of a projective transformation is also a projective transformation.

Computer Graphics Inf4/MSc 2/11/2007Lecture Notes #1332 Texture filtering. Pixel footprint changes from pixel to pixel –No single filter. Resampling theory : two cases –Magnification – interpolate texel values. –Minification – average texel values. Texture Image

Computer Graphics Inf4/MSc 2/11/2007Lecture Notes #1333 Texture filtering Need to filter texels to avoid aliasing. Useful filter shape is a weighted ellipse whose dimensions are controlled by the projective warp. – EWA filter.

Computer Graphics Inf4/MSc 2/11/2007Lecture Notes #1334 MIP map d u v d=2 d=4 uv d Multum In Parvo = Many things in a small place Sub-sample the texture, and store filtered samples in a pyramid. When interpolating the texel value, use d parameter – texel : pixel ratio and tri-linearly interpolate. - Efficient in storage as well.

Computer Graphics Inf4/MSc 2/11/2007Lecture Notes #1335 Texture mapping summary. Paste a 2D image onto projected geometry. Required transformation is a 2D image warp. Need for projective interpolation. Texture filtering. –EWA –Mip-map.

Computer Graphics Inf4/MSc 2/11/2007Lecture Notes #1336 Recommended Reading Foley et al. Chapter 16, sections up to and including section Also Chapter 17, sections and Introductory text Chapter 14, sections up to and including section Introductory text doesn’t cover MIP mapping.