Finishing Lighting and Shading
- We have lighting model.
- Out of sheer laziness look at Wikipedia's Implementation
- The shader is passed
- Here the vertex shader
- Has a different transformation for the normals
- Some transformations mess with the surface normals.
- It also preserves the transformed coordinates.
- Normals, and coordinates are interpreted in the pipeline
- Then the fragment shader
- Gets the interpolated surface normal and coordinates of the fragment
- Implements the lighting equation.
- If this model is applied to the entire surface
- Compute once using "the" surface normal
- Apply the lighting model
- Use this on the entire surface
- You have flat shading.
- If the model is applied to each vertex
- Then the colors interpolated across the polygon
- This is the Gourand shading model (1971)
- If the surface normals are interpolated
This is Phong-Blinn shading
- Each iteration becomes more realistic and more expensive.
- Gourand and Phong-Blinn make poliginal objects appear "round", Flat shading does not.
- Phong-Blinn make very nice specular highlights, Gourand does not.
- See color plates 3, 4 and 18
- Regardless of method, low polygon count shapes will have "angular" profiles.