Posts: 832
Joined: 2002.09
Post: #1
I'm trying to set the glMaterial (GL_FRONT, GL_SHININESS, matShine); in an application. It works on my ATi card, but not on the Nvidia. I set up the app with this:

Quote:GLfloat mat_specular[] = { 1.0, 1.0, 1.0, 1.0 };
GLfloat mat_ambient[] = {0, 0, 0, 1};
GLfloat mat_shininess[] = { 20 };
GLfloat light_position[] = { 0.0, 1.0, 1.0, 0.0 };
glMaterialfv(GL_FRONT, GL_SPECULAR, mat_specular);
glMaterialfv(GL_FRONT, GL_SHININESS, mat_shininess);
glMaterialfv(GL_FRONT, GL_AMBIENT, mat_ambient);
glLightfv(GL_LIGHT0, GL_POSITION, light_position);

I know that the call with GL_AMBIENT works out fine, and all of this is copy-pasted out of the Red Book. The GL context gets the makeCurrentContext message just before this block, and as I said, this works on an iBook with a Radeon. My GF2MX just ignores the shininess value.

Is there anything I need to do (a glEnable call, perhaps) or something? I guess that this is all due to the ATi driver being more forgiving than the Nvidia one, but... I can't get it to work, damnit! :-/
Quote this message in a reply
Posts: 869
Joined: 2003.01
Post: #2
You also have to set the light specular color to get specular reflections, this is what i do:
PHP Code:

Maybe the default values on ATI and nVidia are different.
Quote this message in a reply
Posts: 832
Joined: 2002.09
Post: #3
Thanks DoG, but it didn't work. Sad I compiled and ran the GLUT examples that come with the dev tools, and they worked fine on both cards. Besides, the GL spec defines the default values, so it can't be that either. I'm going nuts over this. (as usual...)
Quote this message in a reply
Posts: 832
Joined: 2002.09
Post: #4
OSC did it for me, but it was actually a number of problems. Thanks anyway! Grin
Quote this message in a reply
Post Reply