Smooth Shading:
Color Interpolation
Andrew G. Zaferakis
UNC Chapel Hill
COMP 236 Spring 2000

Homework 5a - Smooth Shading
    For this assignment, we implemented smooth shading, or color interpolation, across the face of a triangle.  To achieve the RGB color values, we peformed perspectively correct clipping, but not rasterization.  The mathematics behind interpolating color is exactly the same as the depth interpolation described in hw3.  What we have found in comparison with various different hardware implementations is interesting.  When using a simple plane with different color values for the four vertices, SoftGL matches hardware in all cases when the plane is not clipped.  When the plane is clipped, we did not match any hardware.  Major errors exist in almost all hardware implementations.  Below are screenshots from various graphics archictectures, showing the inaccuracies.  nVidia's GeForce 256 does perform perspectively correct color interpolation, and it should be considered correct.  What is interesting is that SGI's InfiniteReality2 architecture does not perform color interpolation correctly, yet it will never appear to look incorrect, the colors always smoothly blend together, which is obviously not the case in other cards (see below).  Try this out on your architecture and see what results you get.  Toggle between SoftGL and OpenGL by pressing the spacebar.  The SoftGL controls are shown below.
    The images on the left are produced from SoftGL, the images on the right are from various video cards.  The first image shows the plane when it is fully in view, which should match perfectly, the second image shows the plane being clipped, it is also rotated so that it is very close to being aligned with the z-axis, which exploits the incorrect perspective color interpolation.

(click on images for larger versions)

SoftGL
nVidia GeForce256
The SoftGL version is not doing perspectively correct rasterization.  You can notice this by looking at the lower left corner, the blue is much larger then on the GeForce256. The GeForce256 is doing perspectively correct color interpolation.  You'll notice the upper right corner's red is larger then the upper left's green, because red is closer.

 
SoftGL
SGI InfiniteReality2
The IR2 will always smoothly interpolate colors, but it is incorrect, you'll notice that the blending of the blue from the bottom left through the top middle is much different then SoftGL.

 
SoftGL
SGI PC Cobalt Chipset
The PC SGI hardware looks to perform the same as the IR2 above.

 
SoftGL
SGI O2
The SGI O2 creates a banding effect with the green where the quad is split into triangles.  I'm not sure what they are doing here in hardware to achieve this result.

 
SoftGL
Matrox MGA Millenium II PowerDesk
The Matrox card is performing similar to the SGI O2.  Still not sure how they are achieving these results.

 
SoftGL Viewer Controls
Mouse  Used to Rotate
Left Button Locks mouse movements to controls
> Zoom In
< Zoom Out
ESC Exit
SPACE Toggle SoftGL vs OpenGL mode
home

346 Sitterson Hall, CB #3175, Chapel Hill, NC 27599-3175, andrewz@cs.unc.edu