title: Why does my color go away when I enable lighting in OpenGL?
body: <p>I am developing a graphics application in C++ with the OpenGL API and GLUT.</p>
  
  <p>To add lighting, I made the following changes in my modelview matrix:</p>
  
  <pre><code>glEnable(GL_LIGHTING);
  glEnable(GL_LIGHT0);
  
  // Create light components.
  GLfloat ambientLight[] = { 0.2f, 0.2f, 0.2f, 1.0f };
  GLfloat diffuseLight[] = { 0.8f, 0.8f, 0.8, 1.0f };
  GLfloat specularLight[] = { 0.5f, 0.5f, 0.5f, 1.0f };
  GLfloat position[] = { 0.0f, 0.0f, 0.0f, 1.0f };
  
  // Assign created components to GL_LIGHT0.
  glLightfv(GL_LIGHT0, GL_AMBIENT, ambientLight);
  glLightfv(GL_LIGHT0, GL_DIFFUSE, diffuseLight);
  glLightfv(GL_LIGHT0, GL_SPECULAR, specularLight);
  glLightfv(GL_LIGHT0, GL_POSITION, position);
  </code></pre>
  
  <p>The lighting largely works I believe, but the colors of my objects all go away. All I see is a black/white silhouette of my overall figure.</p>
  
  <p>I was wondering why this is?</p>