March 2013
Intermediate to advanced
984 pages
26h 18m
English
First, you need to enable blending. The blending factors you most likely want to use are GL_SRC_ALPHA (source) and GL_ONE_MINUS_SRC_ALPHA (destination). Alternatively, you can use GL_ONE for the destination factor to make lines a little brighter where they intersect. Now you’re ready to draw whatever points or lines you want antialiased. The antialiased effect is most noticeable if you use a fairly high alpha value. Remember that since you’re performing blending, you might need to consider the rendering order. However, in most cases, the ordering can be ignored without significant adverse effects.
Example 4.9 shows the initialization for line antialiasing.
Example 4.9. Setting Up Blending for Antialiasing Lines: antilines.cpp ...