Part II

 1. Shading techniques.

 1.1 Classical illumination model of a polygon mesh

  In the classical case (not the radiosity), the intensity (color or
  gray-scale) at each pixel, corresponding at a polygon, is calculated
  in attributing one color per facet (constant shading), by scalar
  interpolation (Gouraud) or vectorial interpolation (Phong).

  [LINK]-[IMAGE]

  For the following example:

  [LINK]-[IMAGE]

 1.2 Shading :

 1.2.1 Constant shading.

  Each facet of the object is illuminated by an average value for the
  entire polygon. This approach is fast and very simple, but it gives
  quite poor realistic results and non smooth surfaces. This is enhanced
  by the Mach effect: the intensity at the vicinities of the edges is
  overestimated for light values and underestimated for dark values.

  [LINK]-[IMAGE] On the left a Connolly surface of the ferrocene in
  Gouraud shading, and on the right the same surface with flat shading.

 1.2.2 Gouraud shading.

  The Gouraud shading eliminates intensity discontinuities by
  interpolating the intensity for each polygon. It uses the normal
  vector at each vertex and edges of the polygon mesh (obtained by
  averaging each normal of the facets sharing the same edge).

  [LINK]-[IMAGE]

  the model determines the intensity at each vertex and then
  interpolates linearely between each normal along the edge and then the
  same way between the edges for every scan-line. This scan-line
  algorythm is very often hardware implemented. The Mach effect is
  allmost completly eliminated (except for very high curvated surfaces).

  [LINK]-[IMAGE]

 1.2.3 Phong shading.

  The Phong shading is like the Gouraud shading based on an
  interpolation algorythm but this time, the interpolation is made by
  vectors. It uses the normals at each facet, the average normals at
  each vertex, and interpolates vectorially along the edges between to
  vertex, and then interpolates the same way between the edges along the
  scan-line (very heavy calculation, as it has a normalisation
  calculation at every step).

  [LINK]-[IMAGE]

  This model gives a nice render to specular lights. A new approach
  recently developped allows to simulate Phong shading for lesser
  computation costs, (see the 2D textures )

 1.2.4 Problems with interpolated shadings.

  The most common problems encountered with interpolated shading are
  overcomed by utilizing triangles as polygon or by enhancing the
  numbers of polygon (which is expensive).

  For example, a highly curved surface (typically a sphere) will clearly
  have a polygonal silhouette. This situation can be improved by
  breaking the surface into a greater number of smaller polygons, but
  with increase in expense.

  Anomalies are introduced also by the interpolation because the
  interpolation is performed after perspective transformation in th 3D
  screen coordinates, rather than in the World coordinates system.

  An orientation dependence exists due to the scan-line algorythm and
  can induce discontinuities when rotating the object, this can be
  overcome by using triangles as polygons.

  Not directly involved in the interpolation procedure but rather when
  calculating normals at each vertex, errors can araise when averaging
  over non-representative normals. As in the example of a sharp-toothed
  edge surface were all the normals at each vertex are parallel, the
  surface will be rendered flat. This can be overcome by assigning an
  eigen normal at each vertex.

  [LINK]-[IMAGE]

  [LINK]-[IMAGE] Chapter 2 and 3.

  [LINK]-[IMAGE]Table of contents.

    _________________________________________________________________


   Responsible : François Savary, [email protected]
   Group of Professor J. Weber, Department of Physical Chemistry,
   University of Geneva
   30, quai Ernest Ansermet CH-1211 Geneva 4
   tél.: +4122 702 65 32
   fax : +4122 702 65 18