How do I make lines look nicer.

Started by
5 comments, last by JizzRoy 23 years, 6 months ago
I know how to do mipmapping on a texture, how do I make lines and simple objects look smoother.
Advertisement
There are two ways to do this...

1. Turn on anti-aliasing.
2. Dress them up in pretty clothes and make them wear makeup.

I think you can pick out which one is the right solution.

S.

ps. for those of you having trouble determining which solution is correct, the answer is #2.
Read NeHe''s Lesson 7 Texture Filters, Lighting & Keyboard Control to learn about making the textures look better.
Read NeHe''s Lesson 21 Lines, Antialiasing, Timing, Ortho View And Simple Sounds, to make line drawing look better (antialiasing).

X
-X-
Hmmm... Just wondering, does OpenGL anti-aliasing automatically take advantage of AA acceleration which we''re starting to see on new cards (Voodoo 5, GeForce 2)?
No, those new cards support full screen antialiasing, either by rendering a super sampled image (the Geforce) or using that weird T-Buffer thing (voodoo) as an accumulation buffer.

Both of these mechanisms are switchable in the driver only. So your app doesn''t have direct control of them.

As for lines - any full OpenGL implementation can render AA lines. Speed is the issue though - you''ve got to turn on blending (sloooow) and fat lines render really, really slowly.

Must buy me that SGI Octane
Paul Grovespauls opengl page
quote:Original post by Anonymous Poster

Hmmm... Just wondering, does OpenGL anti-aliasing automatically take advantage of AA acceleration which we''re starting to see on new cards (Voodoo 5, GeForce 2)?


in this case itll be a disadvantage
FULL SCREEN AA - halve or quarter the fps
TURN ON LINE ANTIALIASING - loose a few percentage off the fps

Many cards dont support antialiased lines (my TNT for example)

There''s a workaround tho:

1. Create 8x8 texture:

_.:[X]:._
_.:[X]:._
_.:[X]:._
_.:[X]:._
_.:[X]:._
_.:[X]:._
_.:[X]:._

Bright pixels in the center, and fades to black on edges.

2. Create a function:
void DrawTexturedLine( const Vec3* start, const Vec3* end, float thikness ) 


That creates a long triangle strip billboard and fills it with a texture.

Gives you perfect antialiased lines with variable thikness.
The nicest way to draw them is to use ONE/ONE blend mode.

PS: Having this function, with a little effort you can create lasers, lightnings and other cool things that are basically lines. You can also animate texture and use "texture tiling".

This topic is closed to new replies.

Advertisement