> On Fri, 21 Jan 2005 01:22:30 +0100, Martijn Sipkema <[EMAIL PROTECTED]> wrote:
> > On Wed, 2005-01-19 at 21:29 -0500, Timothy Miller wrote:
> > > I did a little more experimentation.  If you have an antialiased line
> > > on integer coordinates that's exactly 45 degrees, the center line is
> > > alpha 1.0.  Depending on how you interpret "coverage", this is
> > > slightly off, because the pixel corners lie slightly outside of the
> > > line, so you don't have 100% coverage.  I'm not sure if I've done the
> > > math right, but it looks like in that case, the pixel should have 83%
> > > coverage.  However, as the line tends toward vertical or horizontal,
> > > the given antialias algorithm tends toward expected results, as far as
> > > I can judge.
> > 
> > I think you are right. Lines near 45 degrees angle appear a little
> > thick. I also wonder if the algorithm is good enough at the line
> > endpoints; it doesn't smooth them.
> 
> Yeah, that's the problem.  Well, I'm not absolutely sure that they're
> really thick.  I think they look thick because they're too bright.  I
> suspect that adding an attenuation function which reduces the center
> alpha from 1.0 to something lower, depending on the angle, will solve
> the problem well enough.

That's what I meant. You could try to compensate for that. Note also
that the coverage is only a linear function of the fragment distance
(center to center) for a horizontal/vertical line, but I suppose you could
try to fit by changing the width and center alpha value.

[...]
> > The glut program below draws lines at various angles using the method
> > you described; it doesn't look bad at all...
> 
> Do you imitate what I'm doing by drawing a smooth polygon?  You're not
> doing the same math that I'm doing.

Not a smooth polygon as in GL_POLYGON_SMOOTH, but a smooth
shaded polygon of wdith 2 with the center alpha 1 and the border alpha zero.
I think that is the same as you had. Have you tried it? I noticed that the MESA
software rasterizer did not render the lines correctly; there were gaps. Don't
know why that happens. AFAICS the OpenGL spec doesn't allow it.
Also, the smooth lines of both the MESA software rasterizer seem to render
incorrectly at the lower left bottom, where all lines come together. That I also
don't understand. The MESA software rasterizer smooth lines are very slow
too...


--ms



--ms
_______________________________________________
Open-graphics mailing list
[email protected]
http://lists.duskglow.com/mailman/listinfo/open-graphics
List service provided by Duskglow Consulting, LLC (www.duskglow.com)

Reply via email to