PDA

View Full Version : glArrayElement()



Allan Walton
09-20-2002, 12:27 AM
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

harsman
09-20-2002, 01:16 AM
If you're using vertex arrays, use glDrawelements or glDrawArrays to render your primitives, otherwise you won't see a speed up.

Allan Walton
09-20-2002, 01:33 AM
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)?

harsman
09-20-2002, 02:09 AM
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.

Allan Walton
09-20-2002, 02:13 AM
Cheers mate

Allan