Performance cost of drawing 3DLines

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
Swarmer
Posts: 100
Joined: Mon Apr 16, 2007 7:23 am

Performance cost of drawing 3DLines

Post by Swarmer »

Is it bad practice for me to have the video driver draw 4000 3D Lines every iteration of rendering in a big for-loop? Is that actually as computationally expensive as it sounds?

If so, is there a better way? These lines never change position. They are always in the same spot (it's just a big grid). It seems like I could save a lot of cycles by not having to specify the same static position every iteration.
Dark_Kilauea
Posts: 368
Joined: Tue Aug 21, 2007 1:43 am
Location: The Middle of Nowhere

Post by Dark_Kilauea »

You could use a scenenode to automate it and allow for culling if the node is outside of the frustrum.

See my grid scene node for a good example, it renders potentially thousands of lines rather quickly.
rogerborg wrote:Every time someone learns to use a debugger, an angel gets their wings.
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

Using a vertex list and drawing with EPT_LINES would make things lots faster. VBOs from Irrlicht 1.5 won't help, though, because the manually drawn verte arrays are not yet supported.
There had been several performance improvements for the grid node, try those as well.
Swarmer
Posts: 100
Joined: Mon Apr 16, 2007 7:23 am

Post by Swarmer »

The grid node works great!

It'd be even better if it used drawVertexPrimitiveList, as hybrid suggested, but it runs good enough already.

The lines farther away clump up a lot and it's just a big gray blob, so a nice option to have would be to have the lines farther spread out as they get farther from the camera.

But it's sufficient already. Thanks.
Post Reply