   Still confused about VBO with complex vertices
  Sorry... it's taking me some time to adapt back to OpenGL and switch back from the concept of "Vertex Layout" introduced with DX10 :)So...I have correctly created a VBO and I've filled it with N vertices of the typex,y,z : float  (pos)u,v,w : float  (nrm)s,t   : float  (tex) A second VBO is filled with triplets of indices (16 bit int)Now I want to draw it, and I suppose I should tell OpenGL how to interpret the data in the VBO, what should be passed to the shader as position, what as normal, what as mapping. So...glBindBuffer(GL_ARRAY_BUFFER, vertices);    glBindBufferARB(GL_ELEMENT_ARRAY_BUFFER, indices); (...something...)glDrawElements(GL_TRIANGLES, ntriangles, GL_UNSIGNED_SHORT, 0);It's that "something" that I still can't understand.glVertexAttribPointer, I think, but I still don't get it what's the correct way of calling it, since I've seen examples scattered around but all seem to refer to SEPARATE buffers like one  for position, one for normals, on for mapping coords and so on.
  HiYou are right that you need to replace (...something...) but you only need to enable client states for vertex, normals and texture coordinates and then set the pointers for them. Something like this:glEnableClientState(GL_VERTEX_ARRAY);glEnableClientState(GL_NORMAL_ARRAY);glEnableClientState(GL_TEXTURE_COORD_ARRAY);glVertexPointer(...);glNormalPointer(...);glTexCoordPointer(...);// Disable what you don't want after with glDisableClientStateCheck out this for a reference.   ;Quote:Original post by Dr YapHiYou are right that you need to replace (...something...) but you only need to enable client states for vertex, normals and texture coordinates and then set the pointers for them. Something like this:*** Source Snippet Removed ***Check out this for a reference.Hi, thanks but, actually, that's the old (deprecated) way to work as far as I know. If you check my (pseudo) code you'll see that I have not separate vertex arrays (pointers) each one containing a different set of data. That's what we used to do back in Opengl 1.0 - 1.5 with Vertex Arrays, the fixed pipeline, and the client states enabling/disabling.Here I am using a Vertex Buffer Object and shaders.   ;  The forward compatible way is replacing every gl*Pointer call with glVertexAttribPointer, but that might confuse you more.When you way triplets of indices, you mean one index for each attribute? If so, that's not supported by GL/DX, you only can use one index array for all attributes.   ;Quote:Original post by HuntsManThe forward compatible way is replacing every gl*Pointer call with glVertexAttribPointer, but that might confuse you more.When you way triplets of indices, you mean one index for each attribute? If so, that's not supported by GL/DX, you only can use one index array for all attributes.Yes proper usage of GlVertexAttribPointer is exactly what I am asking for...As for indices no, just I was just referring to three indices for each triangle :) , I shouldn't have messed up the description with useless info   ;  Did you not understand my explanation in your first thread? I thought I was pretty clear about how to use glVertexAttribPointer.VBO: Vertex structure & interpolationAlso if you need more specific detail about the arguments, you can find them here:glVertexAttribPointer