- Asked 9/25
- 2073 Shrawan · 7 marks
- 2070 Asar · 6 marks
- 2076 Asoj · 8 marks
- 2078 Bhadra · 6 marks
- 2076 Chaitra · 6 marks
- 2067 Mangsir (old course) · 7 marks
- 2074 Chaitra · 8 marks
- 2071 Shrawan · 6 marks
- 2081 Chaitra (new course) · 1 mark
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
-
Find the normal at each polygon vertex by averaging the unit normals of the polygons sharing that vertex:
N_v = (Σ N_k) / |Σ N_k|
-
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
-
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.)
-
Normalise N at each pixel (and the pixel position gives L, V).
-
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)
Related questions
- Gouraud shading for polygon rendering · Computer Graphics, chapter 8 · asked 6×
- Compare Gouraud and Phong shading · Computer Graphics, chapter 8 · asked 7×
- Fast Phong shading · Computer Graphics, chapter 8 · asked 2×
- Phong shading and Mach-band effect · Computer Graphics, chapter 8
- Spatial orientation / normal of a polygon · Computer Graphics, chapter 6 · asked 5×
- Polygon table and normal of S1 · Computer Graphics, chapter 6