views:

664

answers:

1

I'm using OpenGL ES to display some objects exported from Blender. Blender provides a list of vertices, a list of the face indices and a list of the 2d texture co-ordinates. Within Blender, and I believe generally in OpenGL, the texture co-ordinates map to each vertex described in the index array.

I suppose I have two questions:

  1. I'm given to understand(see the "Applying Textures" section) that in OpenGL ES the texture co-ordinates map to the vertex buffer only, not the index buffer. Is this the case or is there a way of binding the texture co-ords to the index buffer instead?

  2. If the above is true, is there anything to be gained from using an index buffer at all? After all to properly map the textures one will need to write out the vertex buffer with all the redundancy that would have been saved with the index buffer. Is there still a performance increase to be gained or are index buffers redundant for textured data?

+4  A: 
Stringer Bell
Thanks for the in depth answer.So vertex info is only consider redundant when it also has the same texture and normal values? And this isn't just limited to OpenGL ES as I first though.
Tom Martin
Well, what I mean by redundant, is when a vertex (with exactly same attributes: color, texcoord, normal, etc) is repeating several times in the description of your mesh.Keep in mind too that when specifying the vertex array and all other attribute arrays (colors, normals etc) they all must have the same element count (and it's valid for OpenGL and DirectX too).
Stringer Bell