Lighting II: specular reflection, generalized lighting models
CS 248 - Introduction to Computer Graphics
Autumn Quarter, 2005
Lecture notes for Thursday, December 1 (finished on Tuesday, December 6)
Table of contents:
- Reflection (continued)
- Generalizing the reflection model
Press here for the Powerpoint slides about
To save time, I did not cover the issue of local versus infinite L and
V in class. I'm leaving it in the notes in case you're interested.
Infinite L, i.e. infinitely distant lighting, is invoked in OpenGL by
setting the homogeneous coordinate W = 0.0 when specifying the position of the
light source in (for example) glLightFv(x,y,z,W). Infinite V,
i.e. infinitely distant viewing, is invoked in OpenGL by setting
GL_LIGHT_MODEL_LOCAL_VIEWER = GL_FALSE in glLightModeli(). Note that moving
the viewer to infinity in this way is only for the purpose of lighting,
not viewing, i.e. it changes the intensities computed for surfaces, but it
does not change the geometry of the image you see.
If vertex normals are passed into the rendering pipeline along with vertex
coordinates, and they can be assumed to be pre-normalized, then the rendering
pipeline doesn't need to perform any square roots at all.
OpenGL natively supports only Gouraud (i.e. intensity) interpolation. Phong
(i.e. normal vector) interpolation is not supported natively, but it can be
implemented (during rasterization) using the flexible shading architecture
available in most modern hardware accelerators. Angle interpolation would be
harder to implement. However, assuming modest changes in normal vector
direction from vertex to vertex, the visual difference between normal and angle
interpolation is small.
Copyright © 2005 Marc Levoy
December 6, 2005 07:32:58 PM