PDA

View Full Version : light GL_SPECULAR doesn't work ?



alex2
02-28-2011, 08:03 AM
I have code:


GLfloat Light[] = {1.0f, 1.0f, 0.0f, 1.0f};
GLfloat LightPosition[] = {0.0f, 0.0f, 3.0f, 1.0f};

glLightfv(GL_LIGHT0, GL_AMBIENT, Light);
glLightfv(GL_LIGHT0, GL_DIFFUSE, Light);
glLightfv(GL_LIGHT0, GL_SPECULAR, Light); //I can delete it
glLightfv(GL_LIGHT0, GL_POSITION, LightPosition);

I can delete glLightfv(GL_LIGHT0, GL_SPECULAR, Light); and I see no difference - why ?

ZbuffeR
02-28-2011, 08:47 AM
Specular highlights can only be seen at some angles, when light bounce on mirror-like surface towards the camera.
Try to choose a better angle.

mobeen
02-28-2011, 09:03 AM
And to make the specular stand out, give it a different color like white color


GLfloat white[4]={1.0f,1.0f,1.0f,1.0f};
glLightfv(GL_LIGHT0, GL_SPECULAR, white);

alex2
02-28-2011, 09:08 AM
thx people