Using OpenGL shaders, I want to render a cube and apply diffuse illumination. My cube consists of 8 vertices, and 12 triangles. I calculate the normal of each triangle by finding the cross product between two of the edges of the triangle. Then, the normal of each vertex is the weighted (by area) average of the triangles it touches. In the vertex shader, to compute the illumination of each vertex, I then calculate the cosine of the angle between the vertex's normal, and the light vector.
However, the problem with this is that whilst each face of my cube is flat, the illumination for each pixel on the face is calculated be interpolating between its four vertices. Given that each vertex has a different normal, the illumination for the face varies smoothly between each vertex, whereas in reality there should be a single illumination value for the entire face.
What should I be doing to resolve this? Or is it impossible to deal with this without adding additional vertices along the cube faces?