# vbo,ibo + Normals

Hello,

drawing a Cube with vbo is not difficult. I define 8 vertices and
then create some indices to draw triangles with that given 8 vertices. But how to handle the normals ? When I wanted to have normales for each triangles, I created as much vertices I need for triangles.

For example, draw a cube with triangles need normally 36 triangles. 6 Faces and 2 triangles per face. When I create a cube with redundant vertices (36) and define a normal for each vertex, it’s easy to understand how to use the normals. But how
to handle it, with just 8 vertices and an amount of 12 normnals, or 6 normals.

regards,
lobbel

It isn’t possible; each vertex can only be associated with a single normal. In this case, you would have to use 24 separate vertexes.

Hi,
regards,
lobbel

for a cube, all normals are directly orthogonal to the plane of the triangle.
so I believe that you could use a geometry shader which would compute the normal with a cross product for each triangle. in that case, you don’t need to even allocate any normal array, or to duplicate any vertex.