PDA

View Full Version : VBO crazyness



mictian
07-10-2005, 10:22 AM
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?

07-10-2005, 10:52 AM
Does glDrawArrays() expect the indices to be something other than integers?glDrawArrays doesn't expect indices at all.

Read the spec on it...

:rolleyes: :p

mictian
07-10-2005, 01:38 PM
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

07-10-2005, 05:11 PM
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 ;)

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

Hlz

07-10-2005, 05:48 PM
... actually it could be a single polygon or trifan. That would explain unique indices like that too.