Around 11 o'clock on May 18, Keith Packard wrote:

> I've been experimenting with 'sharp' polygons, those with aliased edges. 
> This is effected by generating a 1-bit mask instead of an 8-bit mask.

Ok, so I think I've got a handle on this (more or less).  Recall that the 
three usual rounding modes (nearest, down, up) generate mispixelated 
results for sharp polygons using our current alpha definition applied to 1 
bit deep masks.  Then recall that nearest also generates negative alpha 
values with smooth polygons when the coverage within a pixel is less than 
1/(2**depth).

I think a reasonable solution is to define a different coverage equation 
for sharp polygons.  I suggest that we use all of the coverage stuff for 
smooth polygons except for the "primitive" area computations -- those 
involving areas to the left of a trapezoid diagonal edge and above a 
horizontal bounding line.  For that primitive computation, I suggest 
making the alpha '1' when the area includes the pixel origin and '0' 
otherwise.  

Apply that to the other existing alpha definitions and you end up with
alpha '1' for any area which includes the origin and '0' otherwise.  The
results appear perfect in my limited tests; I'm a bit concerned about
tesselation where many edges pass through the pixel origin, but I think
even those are correct.

Now I can draw sharp or smooth polygons and they look fine on the screen.  
Of course, the sharp polygons are *ugly*, but then that's life in non-AA 
land.

Keith Packard        XFree86 Core Team        HP Cambridge Research Lab


_______________________________________________
Render mailing list
[EMAIL PROTECTED]
http://XFree86.Org/mailman/listinfo/render

Reply via email to