Skip to main content

Phong shading method

Short answer

Phong shading interpolates surface normals across the polygon and applies the illumination model at each pixel. Vertex normals are averaged from adjacent faces; normals are interpolated linearly along edges and scanlines, then normalized. Intensity I = ka·Ia + IL[kd(N·L)+ks(N·H)^n] is computed per pixel, producing realistic highlights but at higher computational cost.

Explain the Phong shading (normal-vector interpolation) method for polygon rendering, with the steps and the necessary mathematical expressions.

Phong shading (normal-vector interpolation) is a polygon-rendering method that interpolates the surface normal across the polygon and applies the illumination model at every pixel. It gives accurate highlights and removes most Mach bands.

Steps

  1. Find the normal at each polygon vertex by averaging the unit normals of the polygons sharing that vertex:

    N_v = (Σ N_k) / |Σ N_k|

  2. Interpolate the normal along the polygon edges. For an edge from vertex 1 to vertex 2, at scan line y_s:

    N = ((y_s − y2)/(y1 − y2)) · N1 + ((y1 − y_s)/(y1 − y2)) · N2

  3. Interpolate along the scan line between the left (a) and right (b) edge intersections, for pixel x_p:

    N = ((x_b − x_p)/(x_b − x_a)) · N_a + ((x_p − x_a)/(x_b − x_a)) · N_b

    (Incremental form: N' = N + ΔN.)

  4. Normalise N at each pixel (and the pixel position gives L, V).

  5. Apply the illumination model at each pixel:

    I = ka·Ia + IL [ kd (N·L) + ks (N·H)^n ]

    where L = light direction, H = (L + V)/|L + V| and n = specular exponent.

 N1 o--------------o N2     edge interpolation of normals
     \   Na ---- Nb  /      scan-line interpolation
      \  (pixel N)  /       -> intensity at each pixel

Features: realistic highlights and smooth results, but slow because the illumination equation is evaluated for every pixel. (Fast Phong shading uses incremental calculation to reduce the cost.)

✓ Answer checked by Claude Opus 5.5 (high effort)

All Computer Graphics chapter 8 questions →