glArrayElement()

Morning,

I’m making a MD3Loader at the minute and just rendering the wireframe of the model.

i was drawing all vertices using glVertex3f but i changed it to the glVertexPointer(), glArrayElement() etc…

the problem is that it’s now MUCH slower (when it should be faster?) any ideas?

i know i’m being vague but the code is like this

for each model (upper, lower, head)
for each mesh in model
for each triangle in mesh
get index
glArrayElement(index)

recurse through model heirarchy…

Cheers

Allan

If you’re using vertex arrays, use glDrawelements or glDrawArrays to render your primitives, otherwise you won’t see a speed up.

That’s fair enough but why is it much much slower (about 10% of the direct approach)?

it’s the same amount of function calls (AFAIK)?

Honestly, I have no idea. Generally, if you do “weird” or unsusual stuff you tend to fall of the drivers fast path and end up going horribly slow. Btw, for additional speed use glDrawRangeElements.

Cheers mate

Allan