Using a different array for vertices and normals in glDrawElements (OpenGL/VBOs)

Posted by Tuxer on Stack Overflow See other posts from Stack Overflow or by Tuxer
Published on 2011-06-28T16:18:44Z Indexed on 2011/06/29 8:22 UTC
Read the original article Hit count: 233

Filed under:
|

I'm currently programming a .obj loader in OpenGL. I store the vertex data in a VBO, then bind it using Vertex Attribs. Same for normals. Thing is, the normal data and vertex data aren't stored in the same order.

The indices I give to glDrawElements to render the mesh are used, I suppose, by OpenGL to get vertices in the vertex VBO and to get normals in the normals VBO.

Is there an opengl way, besides using glBegin/glVertex/glNormal/glEnd to tell glDrawElements to use an index for vertices and an other index for normals? Thanks

© Stack Overflow or respective owner

Related posts about opengl

Related posts about vbo