Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

I've got multiple buffers in OpenGL holding data on position, normals and texcoords.

I also have an equal number of buffers holding distinct index data for each of those buffers.

I quite like this format (indvidual indexes for each buffer) utilised by COLLADA since it strikes me as optimally efficient at accessing each buffer.

I've set up pointers to the relevant data arrays using VertexPointer, NormalPointer, etc however I have no way to assign pointers to the index buffers since DrawElements appear to only look at one ElementArrayBuffer.

Can I utilise multiple indices some way or will I be better off using a different technique which can support this? I'd prefer to keep the distinct indices if at all possible.

share|improve this question

2 Answers 2

up vote 1 down vote accepted

You can have bound only one index array at a time. So you cann't use separate index array for each vertex attribute. So only choice is to rearrange all arrays according to one index array.

share|improve this answer
    
Ouch. I almost might as well not bother with the indices... I'll accept shortly failing any other suggestions. –  Rushyo Jun 19 '11 at 20:07

GL.MultiDrawElements should be able to do this. Check out the documentation for this function.

share|improve this answer
    
This can be used for more models (geometry), but not for attributes. Attributes of one model are using the same index array. –  zacharmarz Jun 22 '11 at 11:50
    
My understanding of this method concurs with zacharmarz's statement. –  Rushyo Jun 22 '11 at 12:26

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.