Not logged in, Join Here! or Log In Below:  
News Articles Search    

 Home / 3D Theory & Graphics / antialiased lines Account Manager
Archive Notice: This thread is old and no longer active. It is here for reference purposes. This thread was created on an older version of the flipcode forums, before the site closed in 2005. Please keep that in mind as you view this thread, as many of the topics and opinions may be outdated.
Peter Bone

February 14, 2005, 07:58 AM

I'm using a Wu line algorithm that I wrote myself based on the explainations given on various websites. It works fine and looks the same as other Wu-line demos but I think it could look better. Have a look at this -

Look at the blue lines and notice how the line goes from light to dark instead of appearing to be the same intensity along it's length. This is caused by the fact that the pixel pairs intensities always sum to 1. When both pixels have equal intensities they have only half the required intensity. The eye is supposed to correct this because it's twice the thickness but it doesn't completely and so the line appears to vary intensity along it's length.
Does anyway have any way to fix this to make the line appear to have uniform intensity along its length? I've found that drawing the line twice (one on top of the other) makes it appear better but obviously this takes twice as long.


Peter Bone

p.s. Does anyone know how to draw anti-aliased circles in a similar way to the Wu-line algorithm?


February 14, 2005, 08:19 AM

this should help you out:

happy coding :)

whole lecture about the problem:

Samuel Hornus

February 14, 2005, 09:06 AM

Also, Eric Chan has cool stuff for antialiased lines:
(This work will also appear in the -- to be released in March -- book GPU Gems 2.

Erik Faye-Lund

February 15, 2005, 02:33 PM

ehm, you wrote a wu-line algorithm yourself, or you implented _the_ wu-line algorithm? (the effect is antialiased lines, wu is an algorithm to use for antialiased lines.)

Peter Bone

March 01, 2005, 08:12 AM

Yes ok, I implemented the Wu algorithm myself.

Peter Bone

March 01, 2005, 08:13 AM

I realize now that what I need is the Gupta Sproull antialiasing algorithm which precomputes a filter to calculate the intensity of pixels. Does anyone have source code for that? I've been to many web sites explaining it and I'll try to *IMPLEMENT* it myself if I can't find any code. I need the Gupta Sproull algorithm for lines and circles.
Why isn't there a library of these basic graphics algorithms somewhere?


Peter Bone


March 04, 2005, 07:14 PM

Gamma correction is an easy way to improve the consistency of the brightness, try it first :)

This thread contains 7 messages.
Hosting by Solid Eight Studios, maker of PhotoTangler Collage Maker.