Re-ordering triangle strips

I asked this question a while ago, but it sort of got buried at the bottom of a thread and was never resolved. Hopefully no one will mind starting a new thread for it.

I’m trying to speed up my project by using triangle strips instead of a series of GL_TRIANGLES, but I’ve been staying away from strips because they introduce a weird sort of asymmetry to the look of things. The triangle ordering from my LOD engine attempts to fix that problem by alternating which opposing pair of vertices in a quad become an edge. Hence, a strip generated by my system would look like |/||/|| wheras an OpenGL triangle strip looks like |||||. Is there any way to accomodate this, or am I resigned to working with individual triangles?

You are forced to the order. However, I believe it would be effective even without strips, since the vertices are sorted and the driver is able to cache the vertices. Try to use arrays for that.

it is possible with strips to do that by drawing a lot of denerant triangles, but half or more of the triangles u draw will actually not be seen. not exactlly the way to get the fastest perfromance

yes, his order would then have a constant overhead, not just occasionally.

Thanks for the insight! Sometimes I wonder why OpenGL doesn’t have some kind of large surface or trigrid primitives. They would be even faster than decomposing to triangle strips because there would be no shared vertices at all if we sent OpenGL an entire mesh at once.

Do you mean something like indexed arrays? I couldn’t imagine another way.

the fastest way to send standard stuff that doesnt share vertices is to use glDrawArrays(…)

Interesting, interesting… Do I have to hard-code the size of the arrays, or can I allocate memory during runtime? Could I set up the arrays with something like:

vertArray = new float[3*numVertices];

I did a quick search for examples, and all of them used fixed-size arrays, but that isn’t general enough.

Also, how inefficient would it be to fill the array with new data for each frame (but not between passes)?

You can use dynamic arrays as well. OpenGL takes a pointer to the buffer and the number and type of elements.

I am newbie, how can I use glDrawArrays(…) to improve my drawing function that uses triangles strips primitives?

Thanks in advance
F.