Sie sind auf Seite 1von 3

Phong and Gouraud Shading

Gouraud shading
Gouraud shading, named after Henri Gouraud, is a method used to simulate the differing
effects of light and color across the surface of an object. It is a very simple and effective
method of adding a curved feel to a polygon that would otherwise appear flat.

Gourauds approach to differing effects:


- An estimate to the surface normal of each vertex (the point where the lines
connect) by averaging the surface normals at that vertex.
- Lighting computations based on the illumination model are then performed to
produce color intensities at the vertices.
- Screen pixel intensities are then interpolated from the color values calculated at
the vertices (i.e. gradient is formed in the area where the vertices meet).

An example will be to compare between flat shading which simply assigns a single color
to a polygon. On the other hand in Gouraud shading colors are assigned to each vertex,
then they are blended across the face of the polygon.
The disadvantage of Gouraud shading:
Imagine you have a large polygon, lit by a light near its center. The light intensity at each
vertex will be quite low, because they are far from the light. The polygon will be
rendered quite dark, which is wrong.
However, if you are using a large number of small polygons, with a relatively distant
light source, Gouraud shading can look quite acceptable.

The advantage of Gouraud shading:


It provides a smoother appearance than flat shading and it is computationally the less
expensive of the two models (i.e. compared to Phong).
This is because it only requires the evaluation of the intensity equation at the polygon
vertices, and then interpolation of these values for each pixel.

Phong Shading
Shading model named after Bui Tuong Phong.

Phongs approach to differing effects:


- An estimate to the surface normal of each vertex
- For each scan line the normal vectors at the end of each line are evaluated by
linear interpolation. These are used for the interpolation of Ns (normal on the
scale line).
- Ns is then used in the intensity calculation at each point or pixel.
The disadvantage of Gouraud shading:
The computational time is very high, involving the interpolation of the surface normal
and the evaluation of the intensity function for each pixel in the polygon.

The advantage of Gouraud shading:


It improves upon Gouraud shading by providing a better approximation of the shading of
a smooth surface.
It also works better for that has small specular highlights.

Das könnte Ihnen auch gefallen