PDA

View Full Version : GL_POLYGON_SMOOTH, is it that bad?



Argumn
02-19-2010, 06:34 AM
I have read on some pages about the evilness of GL_POLYGON_SMOOTH usage but I am unable to find any evidence of its evilness in the open gl docs.

Are there some known facts? Is it implemented well, is it fast and so on?

And if GL_POLYGON_SMOOTH is evil, which replacement should be used in order to smooth objects?

We do not draw GL_POLYGONs, but we draw triangles and on some systems the smooth also causes effects on triangle edges which should not be smooth.
Like if you have a quad constructed from two triangles then you may want the edges on the outline of this quad to be smooth but definitely not the inner edges :)


Edit: I have read about multisample anti aliasing but I am not sure if this will run on our target system, which is a low end in-field notebook without a dedicated video card.
and is MSAA FSAA ? Nehes lesson 46 talks about MSAA as it were FSAA

ZbuffeR
02-19-2010, 06:46 AM
low end in-field notebook without a dedicated video card.
Try at least to name the video chip, it will help...

ZbuffeR
02-19-2010, 07:37 AM
Polygon smooth has one big problem, it does not work well with depth testing. MSAA/FSAA is the only way to do it correct.

strattonbrazil
02-19-2010, 10:07 AM
We do not draw GL_POLYGONs, but we draw triangles and on some systems the smooth also causes effects on triangle edges which should not be smooth.


That's evil right there. Well, evil's a strong word, I guess. Anytime you're drawing triangle (even using GL_POLYGON they end up being rasterized as triangles usually) you don't know about you're neighboring triangles, so GL_POLYGON_SMOOTH will actually blend the edges against the buffer, which looks weird if it's inside the the silhouette of the mesh.

As ZbuffeR said, you need FSAA. There are several approaches to doing this but if you're targeting really low-end hardware, you might need to do some kind of tiling approach.

dukey
02-19-2010, 10:12 AM
Create a multi sampled buffer, the extension is a decade old now. I am sure your crappy hardware can handle it.

http://www.opengl.org/registry/specs/ARB/multisample.txt

Aleksandar
02-19-2010, 12:07 PM
Create a multi sampled buffer, the extension is a decade old now. I am sure your crappy hardware can handle it.

I wouldn't bet on it. A year ago, I had to deal with some ruggedized laptop (special purpose stuff) which did not support multi-sampling. And that hardware is not a decade old.

Alfonse Reinheart
02-19-2010, 12:19 PM
And if GL_POLYGON_SMOOTH is evil, which replacement should be used in order to smooth objects?

If the hardware is as "low end" as you say, who cares? They just won't get antialiasing. At some point, you have to accept the limitations of your hardware.