Next:
Phong Shading
Up:
Shading
Previous:
Introduction
Gouraud Shading
Gouraud shading
interpolates colours across a polygon from the vertices.
Lighting calculations are only performed at the vertices.
Works well for triangles
Barycentric combinations are also
affine combinations
...
Triangular Gouraud shading is
invariant
under affine transformations.
\
To implement, use repeated affine combination
Similar to scan conversion of triangles
(picture)
Gouraud shading is well-defined only for triangles
For polygons with more than three vertices:
Sort the vertices by
y
coordinate.
Slice the polygon into trapezoids with parallel top and bottom.
Interpolate colours along each edge of the trapezoid...
Interpolate colours along each scanline.
\
Gouraud shading gives
bilinear
interpolation within each trapezoid.
Since rotating the polygon can result in a different trapezoidal decomposition,
n
-sided Gouraud interpolation is
not affine invariant.
Highlights can be missed or blurred.
Common in hardware renderers; model that OpenGL supports.
Exercise: Provide an example of the above effect.
Exercise: Prove the above algorithm forms a barycentric combination on triangles.
CS488/688: Introduction to Interactive Computer Graphics
University of Waterloo
Computer Graphics Lab
cs488@cgl.uwaterloo.ca