2
votes

I'm not getting any anti-aliasing when using drawing GL_TRIANGLE_FANs with this code:

  glDisable(GL_DEPTH_TEST);

  // Blended points, lines, and polygons.
  glEnable(GL_BLEND);
  glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);

  glHint(GL_POINT_SMOOTH_HINT, GL_NICEST);
  glHint(GL_LINE_SMOOTH_HINT, GL_NICEST);
  glHint(GL_POLYGON_SMOOTH_HINT, GL_NICEST);

  glEnable(GL_POINT_SMOOTH);
  glEnable(GL_LINE_SMOOTH);
  glEnable(GL_POLYGON_SMOOTH);

What am I doing wrong?

1

1 Answers

4
votes

Edge antialiasing is always a hint, the implementation (you don't specify which) is free to ignore it per the spec. For various reasons (e.g. the inability to handle intersecting polygons, bad interactions with framebuffer blending) this sort of antialiasing has fallen out of favor and been replaced by multisample-based algorithms that work at the framebuffer level. There is an ARB multisample extension to control this (I believe it's default in recent versions of the spec, actually). Or often the drivers have ways to enable it globally without source code modification.