View Full Version : glHint with line, point, polygon smoothing hints

07-09-2008, 10:47 PM
Could anybody observe the effect of using GL_POINT_SMOOTH_HINT, GL_LINE_SMOOTH_HINT or GL_POLYGON_SMOOTH_HINT on the antialised primitives?

For example I'm using


// draw line

for the line smoothing. Line smoothing works fine but the line is still drawn in the same way with GL_DONT_CARE. I tried this with different linewidths and
lines drawn with different angles. However, I could not see any difference. It is same for other hints.

Do I need any other OpenGL calls?

07-10-2008, 04:43 AM
Hints are just hints, they may have or may not have any effect, depending on the GL implementation.
I remember FOG quality hints being somewhat used on some nvidia cards, but that's it.

Ilian Dinev
07-10-2008, 09:51 AM
lines get just 4 different alpha-values for the antialiasing (it's still ugly). Hardware-accelerated, but ugly enough to make you do custom shader-based line-AA (with 4px wide lines)

points become solid circles, but it's software-emulated

polygon edge AA works with strict requirements on the depth-buffer setting, and is still 4-values-ugly.

Radeon9600: none works iirc.

07-12-2008, 03:02 AM
For what it's worth, GPU Gems2 has a great chapter on prefiltered lines. I just moved the whole thing to the GPU (requires a geometry shader to near clip the line and convert it to a tristrip) so I'm feeling particularly pleased with myself. Pretty simple, really fast, and they look marvelous. An added perk is a uniform look across a variety of hw.

In a nutshell the idea is simply to create 4 planes to bound the extent of the line and its filter and discard the fragments on the outside in a shader, alpha blending what's left inside as a function of distance to the line with your filter of choice (Gaussian works great).

07-12-2008, 04:00 AM