PDA

View Full Version : glDrawElements and Normals in different arrays



manolopm
09-12-2010, 04:14 PM
Hi:

I have four arrays. One with all the vertex, other with all the normals, another with the index of the vertex per face and the last one with the index of the normals per face.

I tried to use glDrawElements to draw it but I don't know how to do to make glDrawElements use a different index array to search the normals.

There is any way to do this? I solve it making glVertex and glNormals by myself but its too slow. VBO will solve this? Any example of any possible solution?

Thanks in advance

Regards from Canary Islands

Alfonse Reinheart
09-12-2010, 04:56 PM
I tried to use glDrawElements to draw it but I don't know how to do to make glDrawElements use a different index array to search the normals.

You don't. The one element index accesses all vertex attributes. Instead, transform your data so that there is only one index list.