Subpixel Accurate At Last!After quite a lot of work, I was able to get the subpixel accuracy into the rasterizer. I ended up not using Chris Hecker's articles after all, because he didn't use homogenous coordinates for his 3D data. Instead I used a variant of Dave Eberly's perspective interpolation function from his book 3D Game Engine Design, 2nd Ed. He uses only integer coordinates, but if you change the input arguments from integer to floating point, then you can use the interpolation function for perspective correct interpolations over arbitrary floating point ranges.
This worked out very well, and I am quite happy with the results. The basic idea is to use this function to figure out what attribute values should exist at the pixel centers instead of using the attribute values of the vertices, whose position can be pretty much anywhere inside the pixel.
When you really think about it, adding subpixel accuracy helps identify the fact that you are really just sampling the geometry that you are rendering and storing the samples in a frame buffer. The grid of pixels in the framebuffer is just a definition of how finely you are going to sample the geometry in your scene. It all makes sense now...
Anyways, here is a screenie of the new function's output: