I am currently working with interleaved arrays, especially the format GL_T2F_C4F_N3F_V3F.
So far i’ve drawn a cube with the following array and indices:
//Format: GL_T2F_C4F_N3F_V3F
// Texture Color Normals Vertices
GLfloat Cube[] = {0.0,0.0, 1.0,1.0,1.0,1.0, -1.07735,-1.07735,-1.07735, -0.5,-0.5,-0.5,
1.0,0.0, 1.0,1.0,0.0,1.0, 1.07735,-1.07735,-1.07735, 0.5,-0.5,-0.5,
1.0,1.0, 1.0,0.0,1.0,1.0, 1.07735, 1.07735,-1.07735, 0.5, 0.5,-0.5,
0.0,1.0, 0.0,1.0,1.0,1.0, -1.07735, 1.07735,-1.07735, -0.5, 0.5,-0.5,
1.0,0.0, 1.0,0.0,0.0,1.0, -1.07735,-1.07735, 1.07735, -0.5,-0.5, 0.5,
0.0,0.0, 0.0,1.0,0.0,1.0, 1.07735,-1.07735, 1.07735, 0.5,-0.5, 0.5,
0.0,1.0, 0.0,0.0,1.0,1.0, 1.07735, 1.07735, 1.07735, 0.5, 0.5, 0.5,
1.0,1.0, 0.0,0.0,0.0,1.0, -1.07735, 1.07735, 1.07735, -0.5, 0.5, 0.5};
//faces: front right left bottom top back
GLubyte indices[] = {0,1,2,3, 1,5,6,2, 4,0,3,7, 5,1,0,4, 3,2,6,7, 6,5,4,7};
That’s the cube with neither lighting nor textures enabled:
And this is the one with lighting enabled and textures disabled:
Obviously the colors from the vertices disappeared and the cube is drawn with the white color of the light.
So what do I need the color at the vertices for if they disappear anyway as soon as I enable lighting? Is it possible to draw the cube with the color which was previously assigned to every vertex with lighting enabled?