PDA

View Full Version : GL Color


ChrisD
2002.08.15, 12:06 AM
Im having color problems...
if I specify a vertex color for drawing lines

glColorsf( 1.0, 1.0, 1.0 );

I get a medium grey color and NOT white.

Why am I getting grey?

Here is my AGL init code...

glBlendFunc( GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA );
glEnable( GL_BLEND );
glEnable( GL_ALPHA_TEST );
glAlphaFunc( GL_GREATER, 0.0 );

glEnable( GL_TEXTURE_2D );
glTexEnvf( GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_ONE );

// BACK GROUND COLOR //
glClearColor(0.0f, 0.0f, 0.0f, 0.0f);

// CLEAR ZBUFFER TO THIS DEPTH //
glClearDepth(1.0f);

glHint( GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST );

glEnable( GL_DEPTH_TEST );
glShadeModel( GL_SMOOTH );

monteboyd
2002.08.15, 12:41 AM
Do you have lighting enabled? If so, that might be causing the problem.

ChrisD
2002.08.15, 12:47 AM
Originally posted by monteboyd
Do you have lighting enabled? If so, that might be causing the problem.

No, None

Im doing my own lighting and sending the points through.

OneSadCookie
2002.08.15, 01:43 AM
I notice you're enabling texturing. Do you have a texture bound?

ChrisD
2002.08.15, 01:58 AM
Originally posted by OneSadCookie
I notice you're enabling texturing. Do you have a texture bound?

Oooo good idea that might be it...

How can UNBIND a texture if its still bound?
Or when does it stop being bound?

OneSadCookie
2002.08.15, 02:01 AM
Textures don't stop being bound.

You can unbind by binding texture 0 (which is treated as a white, opaque texture). That puts you back to the state you were in before you first bound a texture.

To be really sure, you should disable texturing.

ChrisD
2002.08.15, 02:48 AM
Originally posted by OneSadCookie
Textures don't stop being bound.

You can unbind by binding texture 0 (which is treated as a white, opaque texture). That puts you back to the state you were in before you first bound a texture.

To be really sure, you should disable texturing.

Oh Yeah BABY!!

That was it.

Thanks for the help :-)