Past exam question: 2082 Kartik (Back), Q6
Open in the Padhaiko appDefine Specular reflection. Explain Fast Phong shading models with relevant expression.
Solution
Definition of Specular Reflection: Specular reflection is the mirror-like reflection of incident light from shiny, polished surfaces (such as metals, plastics, and glazed ceramics) concentrated into a narrow lobe around the direction of ideal reflection.
- Unlike diffuse reflection (which scatters equally in all directions by Lambert's cosine law), specular reflection produces bright highlight spots whose perceived intensity varies strongly with viewing direction.
- In Phong's empirical illumination model, specular intensity is expressed as:
where is point light source intensity, is the specular reflection coefficient (), is the unit reflection vector, is the unit viewing direction vector toward the eye, and is the specular reflection exponent (shininess parameter, where larger creates smaller, sharper highlights).
Motivation Behind Fast Phong Shading: Standard Phong shading interpolates surface normal vectors across polygon edges and scanlines, normalizing each vector and evaluating the dot products and at every individual interior pixel.
- Normalization requires computing an inverse square root , which introduces severe floating-point bottlenecks in software and hardware rasterizers.
- Fast Phong shading approximates the per-pixel normal vector normalization or the resulting illumination intensity directly using Taylor series expansions or bivariate polynomials, drastically cutting computational cost while maintaining highlight shape.
Mathematical Formulation of Fast Phong Shading: Let the unnormalized interpolated normal vector at pixel on a polygon face be expressed linearly across the scanline:
The unit normal vector is . Its squared length is:
Using a second-order Taylor series expansion about the center of the polygon , the inverse norm is approximated as:
Similarly, Bishop and Weimer showed that the diffuse factor and specular factor (using the halfway vector ) can be directly approximated by a second-degree bivariate polynomial in screen coordinates :
Scanline Evaluation via Forward Differences: The polynomial coefficients are computed only once per polygon. Along any horizontal scanline (), the 2D polynomial reduces to a 1D quadratic function in :
Its value at consecutive pixel columns () is evaluated incrementally using forward finite differences:
- First difference:
- Second difference:
During scanline traversal:
This reduces per-pixel calculation to just two integer/fixed-point additions, completely eliminating vector normalization, square roots, and exponentiation.
- Specular reflection is mirror-like reflection from shiny surfaces producing highlights governed by .
- Fast Phong shading replaces costly per-pixel normal vector normalizations with a second-order Taylor or bivariate polynomial expansion:
which is evaluated along scanlines using incremental forward finite differences requiring only two additions per pixel.
All past exam questions for Computer Graphics and Visualization