My implementation of OpenGL displays ambient light normally while running in the iPhone OS simulator, but acts as if ambient light color was 0,0,0 on the device.
I activate lighting like so:
Working...


Not working...


Thanks for any help/ideas.
-Josh Rosen
I activate lighting like so:
Code:
glEnable(GL_LIGHTING);
glEnable(GL_LIGHT0);
GLfloat ambient[] = {0.6, 0.6, 0.6, 1.0 };
GLfloat diffuse[] = { 1, 1, 1, 1 };
GLfloat specular[] = { 0,0, 0, 1.0 };
glLightfv(GL_LIGHT0, GL_AMBIENT, ambient);
glLightfv(GL_LIGHT0, GL_DIFFUSE, diffuse);
glLightfv( GL_LIGHT0, GL_SPECULAR, specular);
GLfloat position[] = { direction.x, direction.y, direction.z, 0.0 };
glLightfv(GL_LIGHT0, GL_POSITION, position);
Code:
GLfloat amb[] = { 1,1, 1, 1.0 };
GLfloat diffuse[] = { 1, 1, 1, 1.0 };
glMaterialfv(GL_FRONT, GL_AMBIENT, amb);
glMaterialfv(GL_FRONT, GL_DIFFUSE, diffuse);
Working...


Not working...


Thanks for any help/ideas.
-Josh Rosen