1

I'm using the following code in order to antialias only the edges of my polygons:

glHint(GL_POLYGON_SMOOTH_HINT, GL_NICEST);
glEnable(GL_POLYGON_SMOOTH);

But it doesn't work.

I can force enable antialiasing by the nvidia control panel, and it does antialias my application polygons. With the code above, I even enabled blending, but it has no effect. Also the rendering code shouldn't be changed since the nvidia control panel can turn it on, and it certainly cant modify my rendering code, it must be some on/off flag. What is it?

I've heard of "multisampling", but I don't need that.

Edit: the nvidia control panel setting is "application controlled" when it doesn't work.

BenMorel
  • 34,448
  • 50
  • 182
  • 322
  • do you create your render context with multisampling? that's what nvidia's control panel changes. – Macke Dec 29 '09 at 17:45
  • It depends on your window system / framework, usually there is a 'samples' value you can set to 4 or 8 somewhere. In windows, it goes into the pixel format struct. – Macke Dec 29 '09 at 19:50
  • Have you got the Antialiasing Settings" in the nVidia control panel set to "Application-Controlled"? – ChrisF Dec 29 '09 at 17:25

4 Answers4

2

You need to ask for a visual/pixelformat with support for multisampling. This is an attribute in the attribute list you pass to glXChooseFBConfig when using GLX/XLib, and wglChoosePixelformatARB when using the Win32 API. See my post here: Getting smooth, big points in OpenGL

Community
  • 1
  • 1
0

It may be that your glEnable call is after the glHint call.

user7116
  • 63,008
  • 17
  • 141
  • 172
  • Interesting, I'm unable to replicate what you're seeing with any of my code. I've got a hunch the NVidia Control Panel is not being your friend. – user7116 Dec 29 '09 at 18:18
0

Try enabling blending

glBlendFunc(GL_SRC_ALPHA_SATURATE, GL_ONE);
glEnable(GL_BLEND);
glEnable(GL_POLYGON_SMOOTH);

Also following article might help

http://www.edm2.com/0603/opengl.html

Raminder
  • 1,847
  • 2
  • 18
  • 30
0

Most likely, your hardware does not support it. Not all OpenGL implementations support antialiased polygons; see the OpenGL FAQ. I've definitely run into this problem before on a first-generation MacBook -- its GPU, the Intel GMA 950, does not support antialiased polygons.

Adam Rosenfield
  • 390,455
  • 97
  • 512
  • 589