Please, the smallest sample to draw antialiased lines ?

Please, the smallest sample to draw antialiased lines ?

Post by Pierre Allie » Fri, 05 Dec 1997 04:00:00



Can I have the smallest sample to draw antialiased lines ?

Context : it's very simple...
I can't draw antialiased lines, I heard it
is necessary to activate Gl_BLEND or something
like that, I precise, lines must have width of 1
pixel.

I would appreciate any response to this topic.

Please make a cc by mail to :

--
Pierre ALLIEZ
Phd student at France Telecom Rennes

 
 
 

Please, the smallest sample to draw antialiased lines ?

Post by Richard S. Wright Jr » Sat, 06 Dec 1997 04:00:00


Do this:

                glEnable(GL_LINE_SMOOTH);
                glEnable(GL_BLEND);
                glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
                glHint(GL_LINE_SMOOTH_HINT, GL_NICEST);
                glLineWidth(1.5);

and all your lines will be antialiased. The glHint() function call is
optional, and so is the glLineWidth(1.5). I find antialiased lines that are
only one pixel wide have a very unsettling "rope" pattern to them. Widening
them ever so slightly makes them look very smooth. With the right color
choices (line against background), they can look almost like a vector
display.

Richard S. Wright Jr.

http://www.magicnet.net/~rwright



> Can I have the smallest sample to draw antialiased lines ?

> Context : it's very simple...
> I can't draw antialiased lines, I heard it
> is necessary to activate Gl_BLEND or something
> like that, I precise, lines must have width of 1
> pixel.

> I would appreciate any response to this topic.

> Please make a cc by mail to :



 
 
 

Please, the smallest sample to draw antialiased lines ?

Post by Richard S. Wright Jr » Sat, 06 Dec 1997 04:00:00


I should really clarify further. There is no such thing as an antialiased
line that is one pixel wide since antialiasing is in fact the blending of
the line's pixels with the neighboring pixels. This makes the border
"fuzzy", yet smooth in appearance.

Richard



> Do this:
> ...
> I find antialiased lines that are only one pixel wide have a very
> unsettling "rope" pattern to them. Widening them ever so slightly
> makes them look very smooth.

> Richard S. Wright Jr.

> http://www.magicnet.net/~rwright

 
 
 

Please, the smallest sample to draw antialiased lines ?

Post by Paul Mar » Sat, 06 Dec 1997 04:00:00



: optional, and so is the glLineWidth(1.5). I find antialiased lines that are
: only one pixel wide have a very unsettling "rope" pattern to them.

Hmm. Are you sure you have set up an appropriate gamma correction for
your monitor? That should eliminate the "ropiness".
--
   -Paul                Hewlett Packard Graphics Products Lab

"Technology can be used for good or evil. Please use only for good."

 
 
 

Please, the smallest sample to draw antialiased lines ?

Post by Howard Stroy » Fri, 12 Dec 1997 04:00:00



: Do this:

:               glEnable(GL_LINE_SMOOTH);
:               glEnable(GL_BLEND);
:               glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
:               glHint(GL_LINE_SMOOTH_HINT, GL_NICEST);
:               glLineWidth(1.5);

: and all your lines will be antialiased. The glHint() function call is
: optional, and so is the glLineWidth(1.5). I find antialiased lines that are
: only one pixel wide have a very unsettling "rope" pattern to them. Widening
: them ever so slightly makes them look very smooth. With the right color
: choices (line against background), they can look almost like a vector
: display.

Using glLineWidth with antialiased lines can produce implementation
dependent results.  Here is an excerpt from the glLineWidth man page
that discusses this:

    If antialiasing is enabled, line rasterization produces a fragment
    for each pixel square that intersects the region lying within the
    rectangle having width equal to the current line width, length equal
    to the actual length of the line, and centered on the mathematical
    line segment.  The coverage value for each fragment is the window
    coordinate area of the intersection of the rectangular region with
    the corresponding pixel square.  This value is saved and used in the
    final rasterization step.

    Not all widths can be supported when line antialiasing is enabled.
    If an unsupported width is requested, the nearest supported width is
    used.  Only width 1 is guaranteed to be supported; others depend on
    the implementation.  To query the range of supported widths and the
    size difference between supported widths within the range, call
    glGet with arguments GL_LINE_WIDTH_RANGE and
    GL_LINE_WIDTH_GRANULARITY.

Just a warning.
--
Howard Stroyan                                                  (970)229-3317
Hewlett-Packard                                             fax (970)229-6318

 
 
 

1. Drawing thick antialiased lines on a bitmap

Anyone tell me how to draw anitialiased lines on a bitmap?

I have an algoritm for a 1 pixel thick line but can not see how to
draw lines thickier than 1 pixel, and my attempts at just drawing 1
pixel lines next each other did not work.

I know there are component suites that encapsulate graphics, but in
this case I just need something simple rather than rewrite my
application to use new components. Speed does not matter etc. and
using the slow canvas.pixels property will do.

The bitmp is just an internal buffer I use pefore painting the drawn
contents onto a TPaintBox.

Thanks

Dave

2. Linux GnuPlot

3. antialiased lines / hidden line removal

4. File info / Keywords import

5. Getting lines to draw with small data values

6. Render hidden-line wireframe?

7. How to draw small lines

8. Why small fonts not antialiased?

9. Small line segments to lines,arcs and splines.

10. general antialiased line source code on the mac?

11. Antialiased scan conversion of 3D Lines

12. Help with antialiased lines