1

Context: Since the index buffer object allows me to prevent duplicating vertices and the texture buffer objects only applies to vertices, I seem unable to wrap the texture properly all the way around the cylinder (no vertices are mapped to the UV coordinates (1, 0) for example). It seems like I need to add an additional set of vertical vertices overlapping the first one but this messes with my calculation of the normals of the vertices.

Question: Is there a way to map texture coordinates to indices instead of vertices or something like that, so that the texture completely wraps around the rolled mesh?

genpfault
  • 47,669
  • 9
  • 68
  • 119
HEYIMFUZZ
  • 95
  • 1
  • 6
  • You can have texture indices too. Read up about vertex attributes. See [here](https://gamedev.stackexchange.com/questions/102389/how-to-implement-index-buffer-object-ibos-with-texture-coordinates-in-opengl) for example. – meowgoesthedog Apr 11 '18 at 01:10
  • 2
    @meowgoesthedog You can't have separate indices for the texture coordinates. If 2 different texture coordinates for the same vertex position are needed., then the vertex coordinate itself has to be doubled and to be paired with both texture coordinates. – Rabbid76 Apr 11 '18 at 04:37
  • There is a Q/A in the OpenGL forum regarding this: [glDrawElements with multi indexing buffers](https://www.opengl.org/discussion_boards/showthread.php/181690-glDrawElements-with-multi-indexing-buffers). It seems that AMD proposed an extention to enable multi-indexing. (I just googled it as I remembered that somebody told me about this.) However, we haven't used it, and I'm not sure how "portable" this is. – Scheff's Cat Apr 11 '18 at 05:51
  • Possible duplicate of [Rendering meshes with multiple indices](https://stackoverflow.com/questions/11148567/rendering-meshes-with-multiple-indices) – Rabbid76 Oct 20 '18 at 16:15

0 Answers0