iDevGames Forums
antialiasing polygons - Printable Version

+- iDevGames Forums (http://www.idevgames.com/forums)
+-- Forum: Development Zone (/forum-3.html)
+--- Forum: Graphics & Audio Programming (/forum-9.html)
+--- Thread: antialiasing polygons (/thread-7380.html)

Pages: 1 2 3


antialiasing polygons - honkFactory - Jan 23, 2003 01:12 PM

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.


antialiasing polygons - DoG - Jan 23, 2003 01:34 PM

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


antialiasing polygons - inio - Jan 23, 2003 01:42 PM

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.


antialiasing polygons - honkFactory - Jan 23, 2003 03:04 PM

What is FSAA?


antialiasing polygons - OneSadCookie - Jan 23, 2003 03:13 PM

Full Scene Anti-Aliasing.


antialiasing polygons - inio - Jan 23, 2003 10:35 PM

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.


antialiasing polygons - inio - Jan 27, 2003 11:12 PM

While I look for some free time to clean up the code, here's a sample of the result:
[Image: AASample.gif]
(That was rendered on a GeForce2, but the output looks identical on a Rage128)


antialiasing polygons - OneSadCookie - Jan 27, 2003 11:47 PM

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 Smile


antialiasing polygons - inio - Jan 27, 2003 11:58 PM

Quote:Originally posted by OneSadCookie
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 Smile
That's a good point... Maybe I should reconsider this patent thing...

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).


antialiasing polygons - OneSadCookie - Jan 28, 2003 01:23 AM

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?


antialiasing polygons - inio - Jan 28, 2003 04:05 AM

Quote:Originally posted by OneSadCookie
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?
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.


antialiasing polygons - DoG - Jan 28, 2003 04:20 AM

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


antialiasing polygons - inio - Jan 28, 2003 05:16 AM

Quote:Originally posted by DoooG
Lines seem to render just fine for me, even smoothed and textured. I have a gf2mx.

- D.G
That'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.

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.


antialiasing polygons - Johan - Jan 28, 2003 06:49 AM

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


antialiasing polygons - inio - Jan 28, 2003 12:51 PM

Quote:Originally posted by JPersson
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
That'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.