OK, I’ve made a test scene, and it exhibits the same problem. I must just be setting light parameters wrong. Here’s some relevant exceprts from my test:
//The only light in the scene
GLfloat ambient0[] = { 0.1, 0.1, 0.1, 1.0 };
GLfloat diffuse0[] = { 1.0, 1.0, 1.0, 1.0 };
GLfloat specular0[] = { 1.0, 1.0, 1.0, 1.0};
GLfloat light0_pos[] = { 50.0, 25.0, -60.0, 1.0 };
//The material on the sphere
float ambientColor[] = {0.33, 0.22, 0.03, 1.0};
float diffuseColor[] = {0.78, 0.57, 0.11, .8};
float specularColor[] = {0.99, 0.91, 0.81, 1.0};
void display()
{
int i;
//Clear necessary bits
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT);
//Apply all our transformations
glMatrixMode(GL_MODELVIEW);
glPushMatrix();
glTranslatef(50, 10, 25);
glPushMatrix();
glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, diffuseColor);
glMaterialfv(GL_FRONT_AND_BACK, GL_AMBIENT, ambientColor);
glMaterialfv(GL_FRONT_AND_BACK, GL_SPECULAR, specularColor);
glutSolidSphere(4.0, 20, 20);
glutSolidSphere(10.0,20,20);
glPopMatrix();
glPopMatrix();
//Get things drawn and swapped
glFlush();
glutSwapBuffers();
}
The lights are set up normally in initialization. This produces the same awful sphere as I’ve had in my other program.