• entries
    316
  • comments
    485
  • views
    321579

Subpixel Accurate!

Sign in to follow this  
Jason Z

130 views

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:

Sign in to follow this  


2 Comments


Recommended Comments

I still have a few things to clean up in the rasterizer unfortunately. It has been a great learning experience, but I am ready to move beyond the rasterizer - there seems to be a constant stream of special cases that really are not fun to work on.

Anti-Aliasing should be a good diversion once I finish off the remainder of my rasterizer to-do list. I'll have to think about the different scenarios to try out...

Share this comment


Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now