PDA

View Full Version : What's faster drawing line with GL_LINES or Texture?



AlexeyZ
08-28-2012, 09:58 AM
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.

V-man
08-28-2012, 05:52 PM
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.

Carmine
08-28-2012, 06:06 PM
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, ... You probably don't have to worry about performance until you get well over 100,000 line segments.

AlexeyZ
08-28-2012, 07:19 PM
Thanks guys! This is the reply I was hoping for :)

dukey
08-29-2012, 05:13 PM
In my 2D app

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

thokra
08-30-2012, 12:11 AM
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.