just a random thought. Would area sampling AA be feasible to implement in HW at all ? I dont mean analytic area sampling ( even this might perhaps be doable with nowadays powerful FP units), but pretty simple coverage-mask implementation. For example, could such implementation be doable ( sorry im thinking in software developer terms, not a HW guru ):
For simplicity, we have a deferred renderer, so you have all your triangles binned/sorted for this tile already. I dont know how triangle setup units work in current hw, but im assuming you have floating-point eye-space X,Y,Z coordinates for every triangle.
Now take a pixel ( i mean final image pixel , not a "fragment" ) to be rendered.
Lets make a "zoomed-up" Z-buffer copy of that pixel into temp buffer, lets say of 16x16 grid. Also, lets have 256 8-bit counters allocated and reset, and 256 registers for storing triangle colour values.
Now start rasterizing triangles into that buffer in front-to-back order ( in HW this would probably need second triangle setup engine working in parallel with "global" one, for software implementation i'd still use the same subroutines ). For first triangle, assign counter #0 and just write out depth values, increasing that counter for each subpixel written. For the next one take ctr #1 and render again, testing depth values. So, in the end you have bunch of counters indicating coverage of each triangle. One could also do early exit when all subpixels have been touched and all of next triangles Z values are smaller than previous one's.
Now for each visible triangle, run pixel shader once to get the colour value, and for final pixel write out coverage weighted colour of all visible tris ( or all 256 tris in HW, zero coverage just wouldnt contribute anything ).
In the end, it would work out to be some kind of coverage mask AA utilizing triangle rasterization engine for coverage calc.
In software, it should be pretty easy to implement and optimization would be pretty trivial, for hardware .. well .. i let the HW wizzes here tear it apart
But even this thing wouldnt work, would area sampling be doable with todays HW ? Im asking because area sampling would be "perfect" AA if we'd have single-coloured polygons, pixel shading makes things a bit more complicated of course.
For simplicity, we have a deferred renderer, so you have all your triangles binned/sorted for this tile already. I dont know how triangle setup units work in current hw, but im assuming you have floating-point eye-space X,Y,Z coordinates for every triangle.
Now take a pixel ( i mean final image pixel , not a "fragment" ) to be rendered.
Lets make a "zoomed-up" Z-buffer copy of that pixel into temp buffer, lets say of 16x16 grid. Also, lets have 256 8-bit counters allocated and reset, and 256 registers for storing triangle colour values.
Now start rasterizing triangles into that buffer in front-to-back order ( in HW this would probably need second triangle setup engine working in parallel with "global" one, for software implementation i'd still use the same subroutines ). For first triangle, assign counter #0 and just write out depth values, increasing that counter for each subpixel written. For the next one take ctr #1 and render again, testing depth values. So, in the end you have bunch of counters indicating coverage of each triangle. One could also do early exit when all subpixels have been touched and all of next triangles Z values are smaller than previous one's.
Now for each visible triangle, run pixel shader once to get the colour value, and for final pixel write out coverage weighted colour of all visible tris ( or all 256 tris in HW, zero coverage just wouldnt contribute anything ).
In the end, it would work out to be some kind of coverage mask AA utilizing triangle rasterization engine for coverage calc.
In software, it should be pretty easy to implement and optimization would be pretty trivial, for hardware .. well .. i let the HW wizzes here tear it apart
But even this thing wouldnt work, would area sampling be doable with todays HW ? Im asking because area sampling would be "perfect" AA if we'd have single-coloured polygons, pixel shading makes things a bit more complicated of course.