Shading Algorithms & Techniques
Shading algorithms determine how surface colors are
computed using illumination models to create the
appearance of smoothness and depth in rendered objects.
1. Introduction
Shading is the process of assigning colors to pixels or vertices based on lighting conditions. It enhances realism by simulating how light interacts with surfaces.
- Improves visual realism
- Works with illumination models
2. Need for Shading
Without shading, objects appear flat and unrealistic. Shading provides depth cues and surface detail.
- Highlights curvature
- Shows light and shadow effects
3. Types of Shading
- Flat Shading
- Gouraud Shading
- Phong Shading
4. Flat Shading
Flat shading assigns a single color to an entire polygon by computing illumination once per face.
- Fast and simple
- Produces faceted appearance
5. Gouraud Shading
Gouraud shading computes lighting at polygon vertices and interpolates intensities across the surface.
- Smoother than flat shading
- May miss specular highlights
6. Phong Shading
Phong shading interpolates surface normals across the polygon and computes illumination at each pixel.
- High-quality smooth shading
- Accurate specular highlights
7. Comparison of Shading Techniques
Flat Shading Gouraud Shading Phong Shading ---------------- ------------------- ------------------- Per-polygon color Vertex intensities Per-pixel lighting Fastest Moderate speed Computationally heavy Faceted look Smooth appearance Very smooth & realistic
8. Advantages
- Improves realism of objects
- Supports smooth surfaces
- Flexible quality-performance tradeoff
9. Applications
- 3D games and animation
- CAD and modeling software
- Scientific visualization
Practice Questions
- What is shading in computer graphics?
- Explain flat shading.
- Differentiate Gouraud and Phong shading.
- Why is Phong shading more realistic?
- Where are shading techniques used?
Practice Task
Explain with diagrams:
✔ Flat vs Gouraud shading
✔ Phong shading normal interpolation
✔ Shading comparison on a curved surface