Skip to main content

Gouraud shading for polygon rendering

Short answer

Gouraud shading calculates vertex intensities using averaged normals and the illumination model, then linearly interpolates them along edges and scanlines. It is fast and removes the faceted look, but highlights inside polygons can be missed, Mach bands may appear, and silhouettes remain polygonal.

Explain the Gouraud shading (intensity-interpolation scheme) for polygon rendering, with its pros and cons.

Gouraud shading (intensity-interpolation scheme) renders a polygon mesh by computing the intensity at each vertex with an illumination model and then linearly interpolating these intensities over the polygon surface.

Steps

  1. Vertex normal: find the normal at each vertex by averaging the normals of all polygons meeting at that vertex.

    N_v = (Σ N_k) / |Σ N_k|

  2. Vertex intensity: apply the illumination model at each vertex using N_v.

  3. Edge interpolation: for a scan line y_s crossing an edge from vertex 1 (y1) to vertex 2 (y2):

    I_a = ((y_s − y2)/(y1 − y2))·I1 + ((y1 − y_s)/(y1 − y2))·I2

    (Incremental form: moving down one scan line, I' = I + (I2 − I1)/(y1 − y2).)

  4. Scan-line interpolation: between the left (a) and right (b) intersection points, for pixel x_p:

    I_p = ((x_b − x_p)/(x_b − x_a))·I_a + ((x_p − x_a)/(x_b − x_a))·I_b

    (Incremental form along the scan line: I_{p+1} = I_p + (I_b − I_a)/(x_b − x_a).)

  5. Fill each pixel with I_p.

 I1 o
    |\
  Ia o--o Ib    I_p interpolated between Ia and Ib
    |    \
 I2 o-----o I3

Advantages

  • Removes the faceted look and gives smooth shading.
  • Much faster than Phong shading, since the illumination model is applied only at the vertices and the interpolation is linear and incremental.

Disadvantages

  • Specular highlights inside a polygon may be missed or appear wrong, because only vertex intensities are used.
  • The Mach-band effect (visible bright or dark bands) can appear at polygon boundaries.
  • The silhouette still looks polygonal.
  • Results depend on the orientation of the polygon on the screen.

✓ Answer checked by Claude Opus 5.5 (high effort)

All Computer Graphics chapter 8 questions →