Department of Computer Sciences Graphics – Spring 2013 (Lecture 15) Illumination Models III: Polygon Shading Shading algorithms apply lighting models to polygons, through interpolation from the vertices. OpenGL uses the present state to compute vertex colors, using the Phong illumination (lighting) model. If the shading model, set by glShadeModel(GL-FLAT) then color is computed (via the Phong lighting model) for only the first vertex in a polygon, and each polygon will appear in a solid color. The University of Texas at Austin 1
14
Embed
Illumination Models III: Polygon Shadingbajaj/graphics2012/cs354/lectures/lect15.pdf · Department of Computer Sciences Graphics ... Illumination Models III: Polygon Shading ... shading
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Department of Computer Sciences Graphics – Spring 2013 (Lecture 15)
Illumination Models III: Polygon Shading
Shading algorithms apply lighting models to polygons, through interpolation from the vertices.
OpenGL uses the present state to compute vertex colors, using the Phong illumination
(lighting) model.
If the shading model, set by
glShadeModel(GL-FLAT)
then color is computed (via the Phong lighting model) for only the first vertex in a polygon,
and each polygon will appear in a solid color.
The University of Texas at Austin 1
Department of Computer Sciences Graphics – Spring 2013 (Lecture 15)
However if the polygons are used to approximate a curved object (such as the quadrics,
and/or NURBs) then
glShadeModel(GL-SMOOTH)
will result in OpenGL performing the Lighting calculation at each vertex, and interpolate
colors across each polygon.
The University of Texas at Austin 2
Department of Computer Sciences Graphics – Spring 2013 (Lecture 15)