Skip to main content

Flat (constant intensity) shading

Short answer

Flat shading fills a polygon with a constant intensity computed from the polygon normal. It is accurate when the polygon truly is a flat face of a polyhedron, and both light source and viewer are at infinity, so N·L and V (or N·H) are constant across the polygon.

Discuss the constant intensity (flat) shading method. Under what condition(s) does flat shading give accurate rendering?

Constant-intensity (flat) shading is the simplest polygon rendering method. A single intensity is calculated for each polygon (using one normal, usually the polygon normal, and one point on the polygon) and the whole polygon is filled with it.

Steps

  1. Find the unit normal N of the polygon (from the plane equation, N = (A, B, C)/|N|).
  2. Calculate the intensity of one point of the polygon using the illumination model: I = ka·Ia + IL [kd (N·L) + ks (N·H)^n].
  3. Fill all pixels of the polygon with this intensity.

Advantages

  • Fast and simple, with few calculations (one per polygon).
  • Good for quick previews.

Disadvantages

  • Faceted appearance: adjacent polygons have different intensities, so edges are clearly visible, even on a curved surface approximated by a mesh.
  • Mach-band effect appears at the edges.
  • Highlights are inaccurate.

Conditions for accurate rendering

Flat shading is accurate when the intensity is really the same over the whole polygon, i.e.:

  1. The object is a true polyhedron, and each polygon is a real flat face (not an approximation of a curved surface).
  2. The light source is at infinity (or far away), so N·L is the same for every point on the polygon.
  3. The viewer is at infinity (or far away), so V (and hence N·H or R·V) is constant across the polygon.

Then the diffuse and specular terms do not change over the polygon. Using smaller polygons in the mesh also improves accuracy.

✓ Answer checked by Claude Opus 5.5 (high effort)

All Computer Graphics chapter 8 questions →