Hello,
I am a learner to opengl, and i write the codes below to test the grayscale.fs which is an example of chapter 17 in OpenGL Superbible. But the result was all the items were black.
Code :
void renderScene(void) {
	glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
	glLoadIdentity();
	gluLookAt(cameraPos[0], cameraPos[1], cameraPos[2], 
		0.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0.0f);
	glViewport(0, 0, windowWidth, windowHeight);
	glLightfv(GL_LIGHT0, GL_POSITION, lightPos);
 
	// Draw red cube
	glColor3f(1.0f, 0.0f, 0.0f);
	glutSolidCube(48.0f);
 
	// Draw green sphere
	glColor3f(0.0f, 1.0f, 0.0f);
	glPushMatrix();
	glTranslatef(-60.0f, 0.0f, 0.0f);
	glutSolidSphere(25.0f, 50, 50);
	glPopMatrix();
 
	// Draw magenta torus
	glColor3f(1.0f, 0.0f, 1.0f);
	glPushMatrix();
	glTranslatef(0.0f, 0.0f, 60.0f);
	glutSolidTorus(8.0f, 16.0f, 50, 50);
	glPopMatrix();
	glutSwapBuffers();
}
Many thanks,