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?
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.
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.
This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.