PDA

View Full Version : Separate specular colour



tdavie
09-21-2000, 01:23 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?

Bob
09-21-2000, 02:08 AM
'Ello, remember me? http://www.opengl.org/discussion_boards/ubb/rolleyes.gif

Separate specular color is defined in OpenGL 1.2 or later, and you need new headers for OpenGL 1.2. Earlier implementations doesn't include separate specular color, and therefore doesn't define this constant.

If your drivers does not currently use OpenGL 1.2, they need to support the extension. If this extension isn't present, and you don't have 1.2, you can't use this feature.

Either get new headers for OpenGL 1.2, or define the missing constant, if the extension is present. The extension constant is define with



#define SEPARATE_SPECULAR_COLOR_EXT 0x81FA


[This message has been edited by Bob (edited 09-21-2000).]