02561 - Computer Graphics - Worksheet 4, Part 6
-
The Phong lighting model is a method used during lighting calculation to include specular highlights. Phong shading is calculating lighting for each fragment instead of each vertex, to allow for smoother lighting. This is especially useful for low-polygon models to allow for more detailed lighting, e.g. using Phong lighting.
-
Using flat shading each triangle is shaded with the same color. Pros: Very easy to implement and calculate. Cons: Very coarse shading leading to harsh edges between triangles.
Gouraud shading is shading at each vertex and interpolating the color on the triangles between the vertices. The normals used for Gouraud shading have to be a normalized average of the normals that share that vertex. Pros: Easy adaptation from flat shading and much smoother results. Cons: Can still produce harsh edges in some cases, does not work as well with low-polygon models.
Phong shading takes Gouraud shading a step further by calculating the color at each fragment by interpolating between the normals of the triangles. Pros: Almost eliminates harsh edges and works well with low-polygon models. Cons: Requires more calculations and can be computationally expensive.
Phong shading is generally better than Gouraud shading for simulating highlights, though at in models with a large number of triangles this difference can be negligible.
-
A directional light is a constant light that comes from a single direction at all points in space similar to the light from the sun. Point lights are lights that come from a single point in space and emits light around it similar to a light bulb. The effect from point lights deteriorates as the distance from the light increases.
-
With Gouraud shading the eye position does not affect the shading, though the Phong lighting model does use the eye position to calculate the highlights.
-
Setting the specular term to zero will completely disable specular highlights.
-
Increasing the shininess will focus the specular highlights, giving it a smaller radius, but increased effect.
-
After the switch to include Phong lighting the lighting was computed in eye space.