0

I'm facing something which seems to be a basic problem with OpenGL since a long time, I tried to find my answer on the web but there is nothing recent.

So the thing is classic, I'm using a vertex shader to render a mesh calling glDrawElements with triangles as primitive. It is possible to calculate averaged normals for each vertex, so I can have exactly the same number of vertex than normals.

Thanks to this, both my array of vertex positions and my array of normals are sharing the same index. Now I want to add the texture coords and the problem is that any vertex can have 1 or more texture coords, and there are no logic links between these coords which means I can't average them to suit exactly the same index than normals and vertex positions.

The solution I found is to extend the initial vertex array with some dummies vertex, with exactly the same position and normals but different texture coord. This was the solution in 2004, but now, what are people doing?

Thanks for the help

Spazz
  • 155
  • 1
  • 10

0 Answers0