Computer Graphics (Fall 2005)To DoCourse OutlineSlide 4Rendering: 1960s (visibility)Rendering: 1970s (lighting)Rendering (1980s, 90s: Global Illumination)OutlineMotivationLinear Relationship of LightGeneral ConsiderationsDiffuse Lambertian TermMeaning of negative dot productsPhong Illumination ModelIdea of Phong IlluminationPhong FormulaAlternative: Half-Angle (Blinn-Phong)Slide 18Triangle Meshes as ApproximationsColoring Between the LinesFlat vs. Gouraud ShadingGouraud Shading – Details 1Gouraud Shading – Details 2Gouraud and Errors2 Phongs make a HighlightProblems with Interpolated ShadingComputer Graphics (Fall 2005)Computer Graphics (Fall 2005)COMS 4160, Lecture 16: Illumination and Shading 1http://www.cs.columbia.edu/~cs4160To DoTo DoWork on HW 3, do wellStart early on HW 4Discussion of midtermBut remember HW 3, HW 4 more importantCourse OutlineCourse Outline3D Graphics Pipeline Rendering(Creating, shading images from geometry, lighting, materials) Modeling(Creating 3D Geometry)Course OutlineCourse Outline3D Graphics Pipeline Rendering(Creating, shading images from geometry, lighting, materials) Modeling(Creating 3D Geometry)Unit 1: TransformationsWeeks 1,2. Ass 1 due Sep 22Unit 2: Spline CurvesWeeks 3,4. Ass 2 due Oct 7Unit 3: OpenGLWeeks 5-7. Ass 3 due Nov 10Midterm on units 1-3: Oct 26Unit 4: Lighting, ShadingWeeks 8,9. Written Ass 1 due Nov 16Ass 4: Interactive 3D Video Game (final project) due Dec 13Rendering: 1960s (visibility)Rendering: 1960s (visibility)Roberts (1963), Appel (1967) - hidden-line algorithmsWarnock (1969), Watkins (1970) - hidden-surface Sutherland (1974) - visibility = sortingImages from FvDFH, Pixar’s ShutterbugSlide ideas for history of Rendering courtesy Marc Levoy1970s - raster graphicsGouraud (1971) - diffuse lighting, Phong (1974) - specular lightingBlinn (1974) - curved surfaces, textureCatmull (1974) - Z-buffer hidden-surface algorithmRendering: 1970s (lighting)Rendering: 1970s (lighting)Rendering (1980s, 90s: Global Illumination)Rendering (1980s, 90s: Global Illumination) early 1980s - global illumination Whitted (1980) - ray tracingGoral, Torrance et al. (1984) radiosityKajiya (1986) - the rendering equationOutlineOutlinePreliminariesBasic diffuse and Phong shadingGouraud, Phong interpolation, smooth shadingFormal reflection equation (next lecture)Texture mapping (in one week)Global illumination (next unit)For today’s lecture, slides and chapter 9 in textbookMotivationMotivationObjects not flat color, perceive shape with appearanceMaterials interact with lightingCompute correct shading pattern based on lightingThis is not the same as shadows (separate topic)Some of today’s lecture review of last OpenGL lec.Idea is to discuss illumination, shading independ. OpenGLToday, initial hacks (1970-1980)Next lecture: formal notation and physicsLinear Relationship of LightLinear Relationship of LightLight energy is simply sum of all contributionsTerms can be calculated separately and later added together:multiple light sourcesmultiple interactions (diffuse, specular, more later)multiple colors (R-G-B, or per wavelength)kkIIGeneral ConsiderationsGeneral ConsiderationsSurfaces are described as having a position, and a normal at every point.Other vectors usedL = vector to the light sourcelight position minus surface point positionE = vector to the viewer (eye)viewer position minus surface point position(x1,y1,z1)N1(x2,y2,z2)N2Diffuse Lambertian TermDiffuse Lambertian TermRough matte (technically Lambertian) surfacesNot shiny: matte paint, unfinished wood, paper, … Light reflects equally in all directionsObey Lambert’s cosine lawNot exactly obeyed by real materialsI N L�:N-LMeaning of negative dot productsMeaning of negative dot productsIf (N dot L) is negative, then the light is behind the surface, and cannot illuminate it.If (N dot E) is negative, then the viewer is looking at the underside of the surface and cannot see it’s front-face.In both cases, I is clamped to Zero.Phong Illumination ModelPhong Illumination ModelSpecular or glossy materials: highlightsPolished floors, glossy paint, whiteboardsFor plastics highlight is color of light source (not object)For metals, highlight depends on surface colorReally, (blurred) reflections of light sourceRoughnessIdea of Phong IlluminationIdea of Phong IlluminationFind a simple way to create highlights that are view-dependent and happen at about the right placeNot physically basedUse dot product (cosine) of eye and reflection of light direction about surface normalAlternatively, dot product of half angle and normalRaise cosine lobe to some power to control sharpness or roughnessPhong FormulaPhong Formula-LRE( )pI R E: g?R =2( )R L L N N=- + gAlternative: Half-Angle (Blinn-Phong)Alternative: Half-Angle (Blinn-Phong)In practice, both diffuse and specular components for most materialsHN( )pI N H: gOutlineOutlinePreliminariesBasic diffuse and Phong shadingGouraud, Phong interpolation, smooth shadingFormal reflection equation (next lecture)Texture mapping (in one week)Global illumination (next unit)Not in text. If interested, look at FvDFH pp 736-738Triangle Meshes as ApproximationsTriangle Meshes as ApproximationsMost geometric models are large collections of triangles.Triangles have 3 vertices, each with a position, color, normal, and other parameters (such as n for Phong reflection).The triangles are an approximation to the actual surface of the object.Coloring Between the LinesColoring Between the LinesWe know how to calculate the light intensity given:surface positionnormalviewer positionlight source position (or direction)How do we shade a triangle between it’s vertices, where we aren’t given the normal?Flat vs. Gouraud ShadingFlat vs. Gouraud ShadingFlat - Determine that each face has a single normal, and color the entire face a single value, based on that normal.Gouraud – Determine the color at each vertex, using the normal at that vertex, and interpolate linearly for the pixels between the vertex locations.glShadeModel(GL_FLAT) glShadeModel(GL_SMOOTH)Gouraud Shading – Details 1Gouraud Shading – Details 1Inter-vertex interpolation can be done in object space (along the face), but it is simpler to do it in image space (along the screen).2 ways for a
View Full Document