Computer Graphics (Fall 2008) COMS 4160, Lecture 18: Illumination and Shading 1

Slides:



Advertisements
Similar presentations
Computer Graphics - Shading -
Advertisements

Computer graphics & visualization Global Illumination Effects.
Virtual Realism LIGHTING AND SHADING. Lighting & Shading Approximate physical reality Ray tracing: Follow light rays through a scene Accurate, but expensive.
The Radiance Equation Mel Slater. Outline Introduction Light Simplifying Assumptions Radiance Reflectance The Radiance Equation Traditional Rendering.
Foundations of Computer Graphics (Spring 2012) CS 184, Lecture 21: Radiometry Many slides courtesy Pat Hanrahan.
Basic Principles of Surface Reflectance
RADIOSITY Submitted by CASULA, BABUPRIYANK. N. Computer Graphics Computer Graphics Application Image Synthesis Animation Hardware & Architecture.
Advanced Computer Graphics (Spring 2013) CS 283, Lecture 8: Illumination and Reflection Many slides courtesy.
Computer Vision - A Modern Approach Set: Radiometry Slides by D.A. Forsyth Radiometry Questions: –how “bright” will surfaces be? –what is “brightness”?
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
Rendering (彩現 渲染).
Representations of Visual Appearance COMS 6160 [Fall 2006], Lecture 2 Ravi Ramamoorthi
IMGD 1001: Illumination by Mark Claypool
Computer Graphics (Fall 2005) COMS 4160, Lecture 16: Illumination and Shading 1
Computer Graphics (Spring 2008) COMS 4160, Lecture 20: Illumination and Shading 2
Advanced Computer Graphics (Fall 2009) CS , Lecture 1: Introduction and History Ravi Ramamoorthi Some.
Lighting and Shading Wen-Chieh (Steve) Lin
Appearance Models for Graphics COMS , Lecture 2 BRDFs and Radiometry Many slides courtesy Pat Hanrahan:
Foundations of Computer Graphics (Spring 2010) CS 184, Lecture 18: Shading & Texture Mapping Many slides from Greg.
Computer Graphics (Spring 2008) COMS 4160, Lecture 15: Illumination and Shading
Advanced Computer Graphics (Fall 2010) CS 283, Lecture 10: Global Illumination Ravi Ramamoorthi Some images courtesy.
Computer Graphics (Fall 2008) COMS 4160, Lecture 19: Illumination and Shading 2
7M836 Animation & Rendering
Basic Principles of Surface Reflectance
Advanced Computer Graphics (Fall 2010) CS 283, Lecture 1: Introduction and History Ravi Ramamoorthi
Objectives Learn to shade objects so their images appear three- dimensional Learn to shade objects so their images appear three- dimensional Introduce.
Computer Graphics (Fall 2004) COMS 4160, Lecture 16: Illumination and Shading 2 Lecture includes number of slides from.
6.1 Vis_04 Data Visualization Lecture 6 - A Rough Guide to Rendering.
University of British Columbia CPSC 414 Computer Graphics © Tamara Munzner 1 Shading Week 5, Wed 1 Oct 2003 recap: lighting shading.
1 Angel: Interactive Computer Graphics 4E © Addison-Wesley 2005 Shading I Ed Angel Professor of Computer Science, Electrical and Computer Engineering,
Illumination and Direct Reflection Kurt Akeley CS248 Lecture 12 1 November 2007
Lighting & Shading.
CS 480/680 Computer Graphics Shading I Dr. Frederick C Harris, Jr.
Fundamentals of Computer Graphics Part 6 Shading prof.ing.Václav Skala, CSc. University of West Bohemia Plzeň, Czech Republic ©2002 Prepared with Angel,E.:
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.
Shading (introduction to rendering). Rendering  We know how to specify the geometry but how is the color calculated.
Shading and Illumination. OpenGL Shading Without ShadingWith Shading.
CSC418 Computer Graphics n Illumination n Lights n Lightinging models.
Rendering Overview CSE 3541 Matt Boggus. Rendering Algorithmically generating a 2D image from 3D models Raster graphics.
Taku KomuraComputer Graphics Local Illumination and Shading Computer Graphics – Lecture 10 Taku Komura Institute for Perception, Action.
Computer Graphics: Programming, Problem Solving, and Visual Communication Steve Cunningham California State University Stanislaus and Grinnell College.
Illumination and Shading
1 Introduction to Computer Graphics with WebGL Ed Angel Professor Emeritus of Computer Science Founding Director, Arts, Research, Technology and Science.
CS 325 Introduction to Computer Graphics 03 / 29 / 2010 Instructor: Michael Eckmann.
Lecture Fall 2001 Illumination and Shading in OpenGL Light Sources Empirical Illumination Shading Transforming Normals Tong-Yee Lee.
Specular Reflection Lecture 27 Mon, Nov 10, 2003.
Local Illumination and Shading
Cornell CS465 Spring 2004 Lecture 4© 2004 Steve Marschner 1 Shading CS 465 Lecture 4.
1 CSCE 441: Computer Graphics Lighting Jinxiang Chai.
Render methods. Contents Levels of rendering Wireframe Plain shadow Gouraud Phong Comparison Gouraud-Phong.
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
01/27/03© 2002 University of Wisconsin Last Time Radiometry A lot of confusion about Irradiance and BRDFs –Clarrified (I hope) today Radiance.
David Luebke3/16/2016 CS 551 / 645: Introductory Computer Graphics David Luebke
Illumination Study of how different materials reflect light Definition of radiance, the fundamental unit of light transfer in computer graphics How the.
Illumination Models. Introduction 1 Illumination model: Given a point on a surface, what is the perceived color and intensity? Known as Lighting Model,
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 (Fall 2004) COMS 4160, Lecture 25: Summary and Preview
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.
Advanced Computer Graphics
Radiometry (Chapter 4).
Illumination and Shading
Computer Graphics (Fall 2003)
Lighting Calculations
Presentation transcript:

Computer Graphics (Fall 2008) COMS 4160, Lecture 18: Illumination and Shading 1

Rendering: 1960s (visibility)  Roberts (1963), Appel (1967) - hidden-line algorithms  Warnock (1969), Watkins (1970) - hidden-surface  Sutherland (1974) - visibility = sorting Images from FvDFH, Pixar’s Shutterbug Slide ideas for history of Rendering courtesy Marc Levoy

1970s - raster graphics  Gouraud (1971) - diffuse lighting, Phong (1974) - specular lighting  Blinn (1974) - curved surfaces, texture  Catmull (1974) - Z-buffer hidden-surface algorithm Rendering: 1970s (lighting)

Rendering (1980s, 90s: Global Illumination) early 1980s - global illumination  Whitted (1980) - ray tracing  Goral, Torrance et al. (1984) radiosity  Kajiya (1986) - the rendering equation

Outline  Preliminaries  Basic diffuse and Phong shading  Gouraud, Phong interpolation, smooth shading  Formal reflection equation For today’s lecture, slides and chapter 9 in textbook

Motivation  Objects not flat color, perceive shape with appearance  Materials interact with lighting  Compute correct shading pattern based on lighting  This 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. OpenGL  Today, initial hacks ( )  Next lecture: formal notation and physics

Linear Relationship of Light  Light energy is simply sum of all contributions  Terms can be calculated separately and later added:  multiple light sources  multiple interactions (diffuse, specular, more later)  multiple colors (R-G-B, or per wavelength)

General Considerations Surfaces have a position, and a normal at every point. Other vectors used  L = vector to the light source light position minus surface point position  E = vector to the viewer (eye) viewer position minus surface point position (x 1,y 1,z 1 ) N1N1 (x 2,y 2,z 2 ) N2N2

Diffuse Lambertian Term  Rough matte (technically Lambertian) surfaces  Not shiny: matte paint, unfinished wood, paper, …  Light reflects equally in all directions  Obey Lambert’s cosine law  Not exactly obeyed by real materials N -L

Meaning of negative dot products  If (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 Model  Specular or glossy materials: highlights  Polished floors, glossy paint, whiteboards  For plastics highlight is color of light source (not object)  For metals, highlight depends on surface color  Really, (blurred) reflections of light source Roughness

Idea of Phong Illumination  Find a simple way to create highlights that are view- dependent and happen at about the right place  Not physically based  Use dot product (cosine) of eye and reflection of light direction about surface normal  Alternatively, dot product of half angle and normal  Raise cosine lobe to some power to control sharpness

Phong Formula -L R E

Alternative: Half-Angle (Blinn-Phong)  In practice, both diffuse and specular components H N

Outline  Preliminaries  Basic diffuse and Phong shading  Gouraud, Phong interpolation, smooth shading  Formal reflection equation Not in text. If interested, look at FvDFH pp

Triangle Meshes as Approximations  Most geometric models large collections of triangles.  Triangles have 3 vertices with position, color, normal  Triangles are approximation to actual object surface

Vertex Shading  We know how to calculate the light intensity given:  surface position  normal  viewer position  light source position (or direction)  2 ways for a vertex to get its normal:  given when the vertex is defined  take normals from faces that share vertex, and average

Coloring Inside the Polygon  How do we shade a triangle between it’s vertices, where we aren’t given the normal?  Inter-vertex interpolation can be done in object space (along the face), but it is simpler to do it in image space (along the screen).

Flat vs. Gouraud Shading Flat - 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 Scan line Actual implementation efficient: difference equations while scan converting

Gouraud and Errors  I 1 = 0 because (N dot E) is negative.  I 2 = 0 because (N dot L) is negative.  Any interpolation of I 1 and I 2 will be 0. I 1 = 0I 2 = 0 area of desired highlight

2 Phongs make a Highlight  Besides the Phong Reflectance model (cos n ), there is a Phong Shading model.  Phong Shading: Instead of interpolating the intensities between vertices, interpolate the normals.  The entire lighting calculation is performed for each pixel, based on the interpolated normal. (OpenGL doesn’t do this, but you can with current programmable shaders) I 1 = 0I 2 = 0

Problems with Interpolated Shading  Silhouettes are still polygonal  Interpolation in screen, not object space: perspective distortion  Not rotation or orientation-independent  How to compute vertex normals for sharply curving surfaces?  But at end of day, polygons are mostly preferred to explicitly representing curved objects like spline patches for rendering

Outline  Preliminaries  Basic diffuse and Phong shading  Gouraud, Phong interpolation, smooth shading  Formal reflection equation

Motivation Lots of ad-hoc tricks for shading –Kind of looks right, but? Physics of light transport –Will lead to formal reflection equation One of the more formal lectures –But important to solidify theoretical framework

Radiance Power per unit projected area perpendicular to the ray per unit solid angle in the direction of the ray Symbol: L(x,ω) (W/m 2 sr) Flux given by dΦ = L(x,ω) cos θ dω dA

Radiance properties Radiance is constant as it propagates along ray –Derived from conservation of flux –Fundamental in Light Transport.

Radiance properties Sensor response proportional to radiance (constant of proportionality is throughput) –Far away surface: See more, but subtends smaller angle –Wall equally bright across viewing distances Consequences –Radiance associated with rays in a ray tracer –Other radiometric quants derived from radiance

Irradiance, Radiosity Irradiance E is radiant power per unit area Integrate incoming radiance over hemisphere –Projected solid angle (cos θ dω) –Uniform illumination: Irradiance = π [CW 24,25] –Units: W/m 2 Radiosity –Power per unit area leaving surface (like irradiance)

Building up the BRDF Bi-Directional Reflectance Distribution Function [Nicodemus 77] Function based on incident, view direction Relates incoming light energy to outgoing light energy We have already seen special cases: Lambertian, Phong In this lecture, we study all this abstractly

BRDF Reflected Radiance proportional to Irradiance Constant proportionality: BRDF [CW pp 28,29] –Ratio of outgoing light (radiance) to incoming light (irradiance) –Bidirectional Reflection Distribution Function –(4 Vars) units 1/sr

Reflection Equation Reflected Radiance (Output Image) Incident radiance (from light source) BRDF Cosine of Incident angle

Reflection Equation Sum over all light sources Reflected Radiance (Output Image) Incident radiance (from light source) BRDF Cosine of Incident angle

Reflection Equation Replace sum with integral Reflected Radiance (Output Image) Incident radiance (from light source) BRDF Cosine of Incident angle