Archived

This topic is now archived and is closed to further replies.

How do I make lines look nicer.

This topic is 6282 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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.

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
Guest 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)?

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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".

Share this post


Link to post
Share on other sites