polygon smoothing problem

Sord
Unregistered
 
Post: #1
I have a problem whenever I enable GL_POLYGON_SMOOTH
It always draws in random (well not so) lines. Mad
I tried using code from the OpenGL Superbible to see if it would do the same and it did.

Here is a picture of it without poly smoothing:
[Image: Picture2.jpg]

And here with:
[Image: Picture1.jpg]

And turned on its side a little:
[Image: Picture3.jpg]
[Image: Picture4.jpg]

I also tried setting the glPolygonMode to disable any wireframe (it wasn't enabled in the first place) but that did nothing (as expected)

Any ideas? I'm using an nVidia GeForce FX 5200 Ultra in my iMac G5.
Note that I am using the hint of GL_NICEST but not changing the hint doesn't fix my problem
Quote this message in a reply
Luminary
Posts: 5,143
Joined: 2002.04
Post: #2
you need to send edge flags to avoid that problem, but I think that will negate the benefits of polygon smoothing in this situation.

polygon smoothing doesn't work, in general. FSAA works much better.
Quote this message in a reply
Member
Posts: 110
Joined: 2002.07
Post: #3
OneSadCookie Wrote:polygon smoothing doesn't work, in general. FSAA works much better.

same here
im using polygon smoothing to see polygone edge when debuging ;-)
Quote this message in a reply
Sord
Unregistered
 
Post: #4
Oh, how do I enable FSAA? (Its not in my book)
Quote this message in a reply
Member
Posts: 110
Joined: 2002.07
Post: #5
fsaa its a sort of screen format
you need to enable when you create your window or you screen

http://developer.apple.com/qa/qa2001/qa1268.html
Quote this message in a reply
Sage
Posts: 1,232
Joined: 2002.10
Post: #6
GL_POLYGON_SMOOTH relies on blending. Each edge of a filled primitive is blended into the framebuffer. The problem is that any kind of blending operation (not just polygon smoothing) is incompatible with the Zbuffer. Think about it: one triangle is drawn, with some pixels outside of one edge partially filled and blended. The Z value for all of those pixels are updated. Then the adjacent polygon is drawn, with some pixels outside the same edge (thus, inside the previous triangle) partially filled and blended. However, those pixel will fail the Z buffer test since they were previously drawn. This gives the result you're seeing.

If you turn off Z buffering, do your own polygon sorting, and use saturation blending, then polygon smoothing will look like you expect. Read this article.

Since doing your own sorting is prohibitive for any kind of complex scene, GL_POLYGON_SMOOTH is not generally useful. It is also being deprecated-- new hardware (any Radeon 9600 or newer, for example) doesn't support GL_POLYGON_SMOOTH. Nothing happens when you enable it.

The proposed replacement is FSAA, which smooths the edges and works with Z buffering. But it requires significantly more VRAM and fillrate, and (depending on the hardware) produces lower-quality results than GL_POLYGON_SMOOTH. So it's debatable about it being "better", look here for some quality comparisons. But it is very easy to enable. Read this Q&A.
Quote this message in a reply
Sord
Unregistered
 
Post: #7
Danlab, thanks for the link.
arekkusu, thanks for the explanation and links!
Quote this message in a reply
Post Reply 

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  Polygon budgets Kerome 1 2,753 Mar 7, 2010 04:55 AM
Last Post: mikey
  glut polygon winding strangeness OptimisticMonkey 2 2,892 Sep 7, 2009 06:27 PM
Last Post: OptimisticMonkey
  Getting the Normal for a polygon. Jaden 3 5,501 May 1, 2009 01:47 PM
Last Post: Nosredna
  Smoothing geometry via subdivision TomorrowPlusX 1 2,722 Aug 30, 2007 02:46 PM
Last Post: OneSadCookie
  Smoothing tangents for bumpmapping TomorrowPlusX 1 2,419 Aug 13, 2007 10:54 AM
Last Post: TomorrowPlusX