I’m having huge problems getting polygon antialiasing to work, developing in Visual C++ 6.0 running on Windows XP. Can someone have a look at my pixel format and tell me if it looks OK? This is the only thing I’m not sure about.
PIXELFORMATDESCRIPTOR pfd = {
sizeof(PIXELFORMATDESCRIPTOR),// size of this pfd
1, // version number
PFD_DRAW_TO_WINDOW | // support window
PFD_SUPPORT_OPENGL | // support OpenGL
PFD_DOUBLEBUFFER, // double buffered
PFD_TYPE_RGBA, // RGBA type
24, // 24-bit color depth
0, 0, 0, 0, 0, 0, // color bits ignored
8, // alpha buffer
0, // shift bit ignored
0, // no accumulation buffer
0, 0, 0, 0, // accum bits ignored
32, // 32-bit z-buffer
0, // no stencil buffer
0, // no auxiliary buffer
PFD_MAIN_PLANE, // main layer
0, // reserved
0, 0, 0 // layer masks ignored
};
Which anti-aliasing technique are you trying to use?
If it is multisampling, look at nehe tutorial. Note you have to first create a dummy window to query the multisample extension and then create a new one with multisample support: http://nehe.gamedev.net/data/lessons/lesson.asp?lesson=46
If it is just the standard OpenGL anti-aliasing, just call
glEnable(GL_POLYGON_SMOOTH) for polygons. Note that if you have
multisampling enabled, this value is ignored.
Hi Overlay: I’m trying to use GL_POLYGON_SMOOTH antialiasing, I don’t want to use multisampling. I’ve got these commands in my initialisation:
glBlendFunc( GL_SRC_ALPHA_SATURATE, GL_ONE );
glEnable( GL_BLEND );
glDisable( GL_DEPTH_TEST );
glHint(GL_POLYGON_SMOOTH, GL_NICEST);
glEnable(GL_POLYGON_SMOOTH);
but the edges of polygons are not appearing antialiased.
Maybe it’s a problem with the Windows OpenGL library?
Even if you succeed in doing anti aliasing with GL_POLYGON_SMOOTH enabled you will be deceived… as Ilian Dinec said in your last thread. Furthermore it is not well supported.
You should try to use a more advanced methods like the ones Ilian or Overlay are suggesting.
I particularly want antialiasing so that my text looks better, converted from TrueType with wglUseFontOutlines. Will any particular antialiasing technique work best for that?