Line Anti-aliasing
By: Akbar A.( syedali011@earthlink.net)
June 13, 2000
In this paper we are going to be talking
about line anti-aliasing and what it is, and how to get rid of it. If you
have been making graphical applications for a little while you will start
to notice "lines" or as we call them jaggies. These jaggies are most apparent
when the lines are nearly horizontal of nearly vertical. jaggies are seen
with lines. you will be able to tell if it is a jaggie if you can see "pixels"
that are not supposed to be part of the line.
Although i could explain to you how
and why these happens (has to do with the line algorithm and where it decides
to draw the next pixel in a line) but i am not going to get into the details.
a video board is not like the "real
world". the computer world is a finite world therefore we have to take
quite a few assumptions . One of these assumptions is drawing lines.
to combat this problem. usually a
graphics api will supply a function in which you can set it so that it
automatically will apply the anti aliasing sub routine on all the lines.
for OpenGL this function is
glEnable(GL_LINE_SMOOTH)
and as for points it is
glEnable(GL_POINT_SMOOTH)
usually when you would enable line
anti aliasing you are going to want to be in a blend mode.
most developers prefer the blend
mode
glBlendFunc(GL_SRC_ALPHA,
GL_ONE_MINUS_SRC_ALPHA)
and if you have read in your models
with color data on each vertex it is better to go with
glBlendFunc(GL_SRC_ALPHA,
GL_ONE)
your best bet is just to experiment
with them.