From: michael <mi...@vp...> - 2001-04-19 13:43:29
|
Yeah, I got it implemented up to the depth sorting of all polygons. Then, realized the beauty of FSAA. Implemented that nice and fast through software with Red Book help and am happy. It's slow in real-time doing the 8 pass jitter, but I'm only creating an off-screen rendered pie charting app, so it works great for what I need. Stephen J Baker wrote: > On Wed, 18 Apr 2001, michael wrote: > >> Whenever I enable GL_POLYGON_SMOOTH, the polys are definitely >> anti-aliased, however, I see the triangular lines outlining the polys >> (also anti-aliased when the depth buffer is disabled). The lines are >> the color of glClearColor like there are holes. Even with the simplest >> case of 1 gluSphere this happens. > > > Basically, you are *doomed*. > > Unfortunately, GL_POLYGON_SMOOTH is something of a kludge - it's > certainly not a general-purpose antialiasing algorithm. That's not > a problem with Mesa specifically - all OpenGL implementations have this > same problem. > > The problem is with the choice of blendfunc and the order of rendering > - and the nature of Z-buffering that conspire together to make this trick > fail with all but the most contrived code. > > * With GL_SRC_ALPHA/GL_ONE_MINUS_SRC_ALPHA, two 50% translucent > surfaces (or one 25% and one 75% or whatever) don't add up to > a 100% opaque surface. The first one blocks out half the light > from the polygons behind it - and the second one blocks out half > of what shone through the first one...hence two 50% opaque polygons > results in only 75% overall opacity. > > * The translucent edges around the smoothed polygons are subject > to Z-buffering - so the translucent edge of one polygon can cause > the translucent edge of the other to be Z-buffered out. > > * The whole thing is rendering-order dependent - so if you render > your line-smoothed polygon *before* the background polygons then > the polygon will be blended against your clear-screen colour, > but if the order is reversed, it'll be blended against the > background polygons. This can get very ugly. > > So, you need to pick a different blend function and render your polygons > in strict back-to-front order with the Z buffer disabled.... > > /\/\ > / \ \ > \ \/ > /\ \ > / \ \ > / /\ \ > ____/ /__\___\__ > | / / | > |__/ /___________| > /___/ \___\ > > > ...good luck trying to sort *that* out! > > ...or you could buy a GeForce card, turn on FSAA using an environment variable > and get *perfect* results without changing a single line of code (ie with > GL_POLYGON_SMOOTH disabled). > > ---- > Steve Baker (817)619-2657 (Vox/Vox-Mail) > L3Com/Link Simulation & Training (817)619-2466 (Fax) > Work: sj...@li... http://www.link.com > Home: sjb...@ai... http://web2.airmail.net/sjbaker1 -- -- Michael G. Martin mailto:mi...@vp... |