VBO crazyness

I have a VBO for vertex data, and a VBO for index data. the vertices are stored as floats, whereas the indices are ints.

I am a little concerned because form some mesh:

glDrawArrays( GL_TRIANGLES, 0, t.ni );

draws useless garbage, whereas:

glDrawElements( GL_TRIANGLES, t.ni, GL_UNSIGNED_INT, NULL );

works fine. Does glDrawArrays() expect the indices to be something other than integers?

Does glDrawArrays() expect the indices to be something other than integers?
glDrawArrays doesn’t expect indices at all.

Read the spec on it…

:rolleyes: :stuck_out_tongue:

owned.

sorry i guess the only reason i thought it did was because my un-optimized models have indices in the form 1,2,3,4…n-1,n

i guess indices like this are unnecessary, and drawarrays produces the identical behaviour

yeah if each index in the element array is unique then it’s pretty bad indexing or it’s a pretty strange model with no shared vertices :wink:

You could fix this yourself by creating your own optimized triangle indices…

Hlz

… actually it could be a single polygon or trifan. That would explain unique indices like that too.