Flat shading with vertex array

I need to implement a flat shading using vertex array.
I have reached a perfect smooth shading computing the average of triangle’s normals sharing each vertex and assigning them to the corresponding elements of normal array.
vertex[i] —> normal[i] = average of sharing triangles normals;
But, this doesn’t work on flat shading.
I know that to reach a correct result I should have to assign the triangle normal to all its vertices normals, but the problem raises on shared vertices.
I don’t want to duplicate the shared vertices to keep their normals and, for speeding problems, I can’t draw my triangles one by one.
How can I solve my problems?


You have to duplicate the vertices. There is no way around it (other than using immediate discrete triangles).

Could you give me further information about immediate discrete triangles?


That’s means drawing triangle’s one by one in a begin/end pair (what you do not want to do).