antialiasing polygons
Howdy
What is the best way to antialias a set of polygons? I am trying to avoid having to depth sort the polys first because the objects that I will be drawing are going to be rotating constantly.
A.W.
What is the best way to antialias a set of polygons? I am trying to avoid having to depth sort the polys first because the objects that I will be drawing are going to be rotating constantly.
A.W.
Quote:Originally posted by honkFactory
Howdy
What is the best way to antialias a set of polygons? I am trying to avoid having to depth sort the polys first because the objects that I will be drawing are going to be rotating constantly.
A.W.
I think you don't need it for FSAA. Otherwise, you must sort.
- D.G
I developed a method that works back to the Rage128 using a two-pass process and doesn't require a depth sort. I was originally considering patenting it but I don't think it's very valuable in the current market, so I decided against that. I'll post a brief rundown here when I get back from school today.
"He who breaks a thing to find out what it is, has left the path of wisdom."
- Gandalf the Gray-Hat
Bring Alistair Cooke's America to DVD!
Full Scene Anti-Aliasing.
ok, I got some physics homework due tomorrow so I don't have as much time right now as I would want, but here's the general idea:
data you need before you start:
1. the scene data
2. polygon connectivity graphs for each model in the scene
3. a list of front-facing polygons in the scene
what you do:
1. render the scene as normal
2. with the polygon connectivity and visible face list, find the edges between visible and backfacing edges ("silhouette edges")
3. render this edges as smooth lines
I have working code that does this and only incurs about a 20% performance hit on a rage 128 (for reasonable polygon geomtry). My implementation makes makes a few other optimizations:
1. only rendering convex silhouette edges and
2. using the depth offset to push the anti-aliased edges back behind the polygon they're on the edge of a bit (without it small stuff looks speared)
3. rendering specific (pre defined) edges in front of the rendered model to smooth high-contrast edges inside the model body.
data you need before you start:
1. the scene data
2. polygon connectivity graphs for each model in the scene
3. a list of front-facing polygons in the scene
what you do:
1. render the scene as normal
2. with the polygon connectivity and visible face list, find the edges between visible and backfacing edges ("silhouette edges")
3. render this edges as smooth lines
I have working code that does this and only incurs about a 20% performance hit on a rage 128 (for reasonable polygon geomtry). My implementation makes makes a few other optimizations:
1. only rendering convex silhouette edges and
2. using the depth offset to push the anti-aliased edges back behind the polygon they're on the edge of a bit (without it small stuff looks speared)
3. rendering specific (pre defined) edges in front of the rendered model to smooth high-contrast edges inside the model body.
"He who breaks a thing to find out what it is, has left the path of wisdom."
- Gandalf the Gray-Hat
Bring Alistair Cooke's America to DVD!
While I look for some free time to clean up the code, here's a sample of the result:
![[Image: AASample.gif]](http://www.inio.org/~inio/AASample.gif)
(That was rendered on a GeForce2, but the output looks identical on a Rage128)
![[Image: AASample.gif]](http://www.inio.org/~inio/AASample.gif)
(That was rendered on a GeForce2, but the output looks identical on a Rage128)
"He who breaks a thing to find out what it is, has left the path of wisdom."
- Gandalf the Gray-Hat
Bring Alistair Cooke's America to DVD!
Very impressive, particularly given that you need very much the same data for stencil shadows -- this might allow polygon antialiasing and stencil shadows simultaneously on today's hardware
Quote:Originally posted by OneSadCookieThat's a good point... Maybe I should reconsider this patent thing...
Very impressive, particularly given that you need very much the same data for stencil shadows -- this might allow polygon antialiasing and stencil shadows simultaneously on today's hardware![]()
BTW, I haven't mentioned performance yet. With the model shown in that pic it's about a 30% raw polygon throughput performance hit on a Rage 128 IIRC. I can't find any of my old log files to verify that though. If someone has a rage 128 and would like to test it, you can get the demo app and a benchmarker here. (Note: where this really falls apart in terms of speed is on the GeForce2 and GeForce3. On these cards it takes about 75% cut in polygon throughput, because of hoops I have to make the graphics card jump through to render the way I want it to (3+ additional passes. some with blends against the destination alpha. ick).
"He who breaks a thing to find out what it is, has left the path of wisdom."
- Gandalf the Gray-Hat
Bring Alistair Cooke's America to DVD!
Quote:Note: where this really falls apart in terms of speed is on the GeForce2 and GeForce3. On these cards it takes about 75% cut in polygon throughput, because of hoops I have to make the graphics card jump through to render the way I want it to (3+ additional passes. some with blends against the destination alpha. ick).
Given that that's something like 80% of the PC market, that's quite a big drawback... you might as well turn on FSAA in that case.
What do those cards do differently to the Rage128?
Quote:Originally posted by OneSadCookieThe GeForce2 and possibly GeForce3 (I'm getting mixed reports) doesn't support rendering lit, textured, smoothed lines. This means I have to use the alpha buffer to hold the mask of the lines, then go back and draw them as thick lines.
Given that that's something like 80% of the PC market, that's quite a big drawback... you might as well turn on FSAA in that case.
What do those cards do differently to the Rage128?
"He who breaks a thing to find out what it is, has left the path of wisdom."
- Gandalf the Gray-Hat
Bring Alistair Cooke's America to DVD!
Quote:Originally posted by inio
The GeForce2 and possibly GeForce3 (I'm getting mixed reports) doesn't support rendering lit, textured, smoothed lines. This means I have to use the alpha buffer to hold the mask of the lines, then go back and draw them as thick lines.
Lines seem to render just fine for me, even smoothed and textured. I have a gf2mx.
- D.G
Quote:Originally posted by DoooGThat's odd, maybe it was a bug in the OpenGL drivers I developed this with. I could get everything working except (2D) texturing and smoothing at the same time. This could be a significant improvement if it was a driver bug.
Lines seem to render just fine for me, even smoothed and textured. I have a gf2mx.
- D.G
BTW, has anyone had a chance to run the benchmarker app in that .sit on a rage 128 yet? I'd be interested in the numbers.
"He who breaks a thing to find out what it is, has left the path of wisdom."
- Gandalf the Gray-Hat
Bring Alistair Cooke's America to DVD!
Quote:Originally posted by inio
BTW, has anyone had a chance to run the benchmarker app in that .sit on a rage 128 yet? I'd be interested in the numbers.
Nope but this is what I got on my tiBook.
GL_RENDERER: ATI Radeon 7500 OpenGL Engine
drew 5585.7k polys per second @ 30.0 fps (gl backface cull)
drew 1054.0k polys per second @ 30.0 fps (local backface cull + anti-alias)
.johan
Quote:Originally posted by JPerssonThat's weird, those numbers are almost identical to what I get on my GF2 with the multi-pass process, but the multi-pass stuff only activates on GeForce2s. I really need to look into this as soon as school calms down.
Nope but this is what I got on my tiBook.
GL_RENDERER: ATI Radeon 7500 OpenGL Engine
drew 5585.7k polys per second @ 30.0 fps (gl backface cull)
drew 1054.0k polys per second @ 30.0 fps (local backface cull + anti-alias)
.johan
"He who breaks a thing to find out what it is, has left the path of wisdom."
- Gandalf the Gray-Hat
Bring Alistair Cooke's America to DVD!
Possibly Related Threads...
| Thread: | Author | Replies: | Views: | Last Post | |
| SLOW performance drawing multiple polygons per frame with stencil buffer | clam61 | 7 | 540 |
Apr 27, 2013 11:53 AM Last Post: clam61 |
|
| glCopyTexSubImage2D vs antialiasing on iPhone? | Mark Levin | 4 | 3,925 |
Jul 16, 2010 01:46 AM Last Post: Bersaelor |
|
| Antialiasing and NSOpenGLView attributes | Jar445 | 2 | 5,606 |
Jan 20, 2009 10:42 AM Last Post: maximile |
|
| n00b question: getting rid of lines along edges of polygons | Andrew | 2 | 2,461 |
Jun 5, 2005 05:57 PM Last Post: Andrew |
|
| Depth Sorting Polygons | thaeez | 2 | 2,869 |
Aug 11, 2004 04:23 PM Last Post: thaeez |
|

