1. Definition
Shading is the process of determining the color and brightness of a surface in a 3D scene based on light interaction.
It relies on two main components:
- Illumination (Lighting Model) – How light sources contribute to the color at a point on a surface.
- Surface Modeling – How the surface properties (like texture, reflectivity, and orientation) affect the way light is reflected.
2. Illumination Models
Illumination models define how light interacts with surfaces. They can be classified into:
A. Local Illumination Models
- Compute color at a point based only on direct light sources and surface properties.
- Ignore reflections from other objects (no global effects).
- Common models:
i. Ambient Lighting
- Uniform light everywhere; represents indirect scattered light.
- No direction; prevents completely black areas.
- Formula:
Iambient=ka⋅Ia
Where ka = ambient reflection coefficient, Ia = ambient light intensity.
ii. Diffuse Reflection (Lambertian)
- Light scattered equally in all directions from a rough surface.
- Depends on the angle between surface normal N and light direction L.
- Formula (Lambert’s Law):
Idiffuse=kd⋅Il⋅max(0,N⋅L)
Where kd = diffuse coefficient, Il = light intensity.
iii. Specular Reflection
- Light reflected in a preferred direction (shiny surfaces).
- Depends on view direction V, light direction L, and surface normal N.
- Phong model formula:
Ispecular=ks⋅Il⋅(max(0,R⋅V))n
Where ks = specular coefficient, n = shininess exponent, R = reflection vector.
Total Local Illumination:
I=Iambient+Idiffuse+Ispecular
B. Global Illumination Models
- Consider light bouncing off other objects (reflections, refractions, shadows, caustics).
- Methods include ray tracing, radiosity, photon mapping.
- Produce more realistic images, but computationally expensive.
3. Surface Modeling
Surface modeling defines how surfaces reflect light. Types:
A. Surface Types
- Matte / Diffuse surfaces – scatter light equally; appear soft.
- Shiny / Specular surfaces – reflect light in preferred directions.
- Transparent / Refractive surfaces – allow light to pass through, bending it according to Snell’s law.
B. Surface Representation
4. Shading Techniques
A. Flat Shading
- Compute one color per polygon using the face normal.
- Quick, but produces faceted look.
B. Gouraud Shading
- Compute vertex colors using normals and interpolate across polygon.
- Smooth appearance, but can miss small specular highlights.
C. Phong Shading
- Interpolate normals across the polygon and compute color per pixel.
- Produces high-quality smooth highlights.
5. Summary Table
| Aspect |
Description |
| Shading |
Determining pixel color based on light and surface properties |
| Illumination |
Ambient, Diffuse, Specular (Local); Ray tracing, Radiosity (Global) |
| Surface Modeling |
Matte, Shiny, Transparent; uses normals and textures |
| Techniques |
Flat, Gouraud, Phong shading |
Key Points:
- Shading combines light sources, surface orientation, and material properties to create realistic visuals.
- Phong model is widely used for per-pixel lighting in modern graphics.
- Surface modeling is crucial for defining how light interacts with objects, affecting realism.