PDA

View Full Version : secondary specular and OGL vertex arrays



Randolph
12-20-2001, 07:34 AM
How can it be achieved? I know, that it should use EXT_secondary_color extension, but how can I tell OpenGL that secondary color pointer means specular? In Direct3D they have it in FVF, but it's rather problematic to use in OGL.

Bob
12-20-2001, 11:19 AM
The secondary color is just a secondary color is the color sum stage. It has nothing to do with lighting. In fact, the secondary color isn't even used when lighting is enabled. If you tell us what you're trying to do, maybe we can point you in the right direction.

Rob The Bloke
12-21-2001, 03:20 AM
I think you mean GL_SEPARATE_SPECULAR_COLOR_EXT

and I think you want something like:


// should be in glext.h
#ifndef GL_EXT_separate_specular_color
#define GL_LIGHT_MODEL_COLOR_CONTROL_EXT 0x81F8
#define GL_SINGLE_COLOR_EXT 0x81F9
#define GL_SEPARATE_SPECULAR_COLOR_EXT 0x81FA
#endif

// check that extension exists before enabling - note, CheckGLExt() is a custom
// function that takes the extension string and searches it to find the requested extension
if( CheckGLExt("GL_EXT_separate_specular_color"))
{
// enable the extension
glLightModelf ( GL_LIGHT_MODEL_COLOR_CONTROL_EXT,GL_SEPARATE_SPECU LAR_COLOR_EXT);
}

that should give you seperate specular highlights, If you want colours in the vertex array to determine the specular color of the geometry, then use glColorMaterial.



[This message has been edited by Rob The Bloke (edited 12-21-2001).]

Randolph
12-21-2001, 11:21 PM
Yes, that is just what I wanted. Thanks.