What's faster drawing line with GL_LINES or Texture?

In my 2D app, I’m looking to draw irregular grid consisting of hundreds of short line segments, similar to how spider’s web look like.

I’m concerned about performance, therefore before embarking on implementation wanted to consult with professionals here, what technique would you guys use to draw something line that?

Couple of points:

  • in my spider’s web I want to be able to manipulate individual lines (change color for example)
  • the web drawing will not be static for example it can shrink or grow thus less or more lines will be drawn

Appreciate any help.

A 100 lines doesn’t sound like much. I’ve seen games render objects in wireframe and any design program such as 3D Studio Max render complex objects in wireframe.

[QUOTE=AlexeyZ;1241941]In my 2D app, I’m looking to draw irregular grid consisting of hundreds of short line segments, similar to how spider’s web look like. I’m concerned about performance, …[/QUOTE] You probably don’t have to worry about performance until you get well over 100,000 line segments.

Thanks guys! This is the reply I was hoping for :slight_smile:

lol you probably won’t have to worry about performance … at all.

And you base that on the fact that the thread starter isn’t planning to have everything happen in on z-plane? You can wreck any “2D” application just as good as you can “real 3D” applications.

AlexeyZ: Not only do a few hundred line segments fail to make your GPU sweat, the constraints you put on your design already rule out using some static, probably alpha-tested texture for your purpose. The CPU overhead is what’s more interesting here. Especially as your web grows.