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.

2. Need for Shading

Without shading, objects appear flat and unrealistic. Shading provides depth cues and surface detail.

3. Types of Shading

4. Flat Shading

Flat shading assigns a single color to an entire polygon by computing illumination once per face.

5. Gouraud Shading

Gouraud shading computes lighting at polygon vertices and interpolates intensities across the surface.

6. Phong Shading

Phong shading interpolates surface normals across the polygon and computes illumination at each pixel.

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

9. Applications

Practice Questions

  1. What is shading in computer graphics?
  2. Explain flat shading.
  3. Differentiate Gouraud and Phong shading.
  4. Why is Phong shading more realistic?
  5. Where are shading techniques used?

Practice Task

Explain with diagrams: ✔ Flat vs Gouraud shading ✔ Phong shading normal interpolation ✔ Shading comparison on a curved surface