I’d like to use antialiasing for polygons, but I have problems with the edges:
I create a simple 4 sided polygon with glBegin(GL_POLYGON); … 4 vertices … glEnd();
Before painting my polygon I enabled blending and polygon smoothing. For the outer lines this looks good, but as 4-vertex Polygons are decomposed to Triangles there still is a a line with a different color in the middle.
What can I do?
Read the OpenGL Programming Guide.
Polygon antialiasing needs depth buffering disabled and geometry sorted from front to back with the saturate alpha blending.
I already tried it. But it resulted in that there was nothing drawn … , but I just read the Qt-documentation ( I use the Qt classes to set up OpenGL ) and the initial setup seems to be that there is no alpha channel enabled in the framebuffer … arghh.
Another question: Is it normal that the edge-flags are ignored for antialiasing a polygon, maybe because the rastering is different?
That teaches that OpenGL developers need to have the full control over the selected pixelformat.
Edge flags have nothing to do with polygon smoothing.
Edge flags would only be effective if you rendered the polygon with glPolygonMode GL_LINE and then the lines wouldn’t be affected by GL_POLYGON_SMOOTH, but by GL_LINE_SMOOTH.