D3PLOT 22.1

Shading Type:

Shading type:

Flat, Smooth and D ithered . This controls how facets are shaded, which in turn affects the appearance of curved surfaces.





FLAT shading 

The outward normal of each element face is calculated and used to determine a single lighting value. This is applied to the whole face giving the faceted appearance shown here.

This is quick to compute and, with a fine enough mesh, gives acceptable image quality.

(The mesh overlay has been added here to emphasise that each facet has a single flat shade.)

SMOOTH shading

The outward normals at each vertex are averaged, making it possible to vary lighting smoothly across a surface. This technique is known as "Gouraud shading", and is only available in 3D graphics mode.

DITHERED shading (2D graphics mode only)

Because gouraud shading is not provided by 2D graphics drivers (or laser plotters) the technique of "dithering" has to be used to produce genuinely smooth shading under 2D graphics. This is done by drawing adjacent pixels in different colours to achieve an intermediate shade - trading of spatial against colour resolution.

Dithered shading is ignored in 3D mode, and should only be used in 2D mode if you are prepared to accept the longer computation and display times involved.


What dithering actually does, and how to fix problems that may arise from its use: (2D mode only)

On the left is an enlarged area of the dithered equivalent of the image above showing the bottom tip of the nose.

The dither pattern is just visible in the image on the left, and if magnified further (right) it becomes obvious.

There are only five different colours used in this image, yet it has been possible to show a wide range of shades. However spatial resolution has been lost in favour of colour range.

Dithering can occasionally cause problems when images are captured from the screen or laser-plotted. In particular there can occasionally be a "heterodyning" (beating) between the spatial resolution used for dithering on the screen and that used by the subsequent display device. This can show up as an apparent chessboard of large lighter and darker squares on the image, or as light/dark bands. Some software packages for manipulating bitmaps may show similar effects.

If this happens you may be able to fix it with one of the following:

  • Try generating the image with a different screen window size, and hence a different scale. This may be enough to stop the "beating" effect.
  • If you have been working at 8 bit-plane resolution, but your screen supports 24 bit-plane "true colour", then use that instead. At 24 bit-plane depth all possible colours that the human eye can resolve (2 24 = 16,777,216) are available, and dithering is not required. The image will look better too.