PDA

View Full Version : Separate specular colour



tdavie
09-21-2000, 01:26 AM
I have been writing an OpenGL based game which uses both texture mapping and lighting. I realised that lighting did not appear to be working on all texture mapped areas. After some reading in the red book, I discovered that what I needed to do was separate the specular colour. This call should have done the trick.



glLightModeli (GL_LIGHT_MODEL_COLOR_CONTROL, GL_SEPARATE_SPECULAR_COLOR);

however my compiler came up with an error - the constants are undefined. Is this a great big hole in Apple's implementation of OpenGL or is the red book talking analy. Anyway, what should I do?

09-24-2000, 11:24 PM
i'm still learning opengl on the mac, so i apologize if what i'm about to say is absolute nonsense. : )

i'm guesssing there might be two problems.
one could be that you may have to use a specific agl command, but i doubt thats it though.
Another thing is that you may have to define the specular color, or the specular related constants. Does the red book mention any extra codes needed, like for gl_lighting commands you can choose color, agle, direction. so maybe specular requires this to in a sense.

well those are my guesses.

http://www.opengl.org/discussion_boards/ubb/biggrin.gif

tdavie
09-25-2000, 04:31 AM
I've worked it out now, you don't need to specify anything extra, it's just normal lighting except with the specular colour applied after the texture. However it only works with OpenGL 1.2, the Apple SDK is only OpenGL 1.0. http://www.opengl.org/discussion_boards/ubb/mad.gif