Where's the green!

Started by
15 comments, last by BradDaBug 22 years ago
OpenGL ignores the green setting when I do glColor3f()! I can call it like this: glColor3f(0.0, 1.0, 0.0); and it''ll still be completely black! it reeds the red and blue colors fine, but refuses to do any green at all!
I like the DARK layout!
Advertisement
Is this lack of green only a problem in your app?? It might be a video card thing, but I''m not sure, I''ve never experinced that type of problem before.


---------------------------------------------------------------------------------------------------------------------------------------
"With my feet upon the ground I move myeslf between the sounds and open wide to suck it in, I feel it move across my skin. I''m reaching up and reaching out. I''m reaching for the random or what ever will bewilder me, what ever will bewilder me. And following our will and wind we may just go where no one''s been. We''ll ride the spiral to the end and may just go where no one''s been." - TOOL
---------------------------------------------------------------------------------------------------------------------------------------
[TheBlackJester]

"With my feet upon the ground I lose myself between the sounds and open wide to suck it in, I feel it move across my skin. I'm reaching up and reaching out. I'm reaching for the random or what ever will bewilder me, what ever will bewilder me. And following our will and wind we may just go where no one's been. We'll ride the spiral to the end and may just go where no one's been." - Maynard James Keenan Name: [email=darkswordtbj@hotmail.com]TheBlackJester[/email]Team: Wildfire Games
Projects O A.D.The Last Alliance

Yup, only in my app. Other stuff works fine.
I like the DARK layout!
Maybe a stupid question, but have you tried other colors? Like 1.0, 0.0, 0.0 or 0.0, 0.0, 1.0? Check your lighting, normals, etc.


Yesterday we still stood at the verge of the abyss,
today we''re a step onward!
Yesterday we still stood at the verge of the abyss,today we're a step onward! Don't klick me!!!
Yeah. Everything works except green.
I like the DARK layout!
Have you got lighting enabled in your scene? With some light colours, you may get red and blue appearing, but not green. A magenta light may do this.
Nope, no lights. Just a simple 2D orthographic (or is it orthogonal?) scene.
I like the DARK layout!
I''ve done some debugging and I''ve figured out it only goes greenless when I include this in the initialization code:

glEnable(GL_TEXTURE_2D);

So why would textures screw up the green?

I like the DARK layout!
If your tex parameter is MODULATE, then each component of final color is determined by multplying the corresponding components of texture color and the color you provided. If your texture has no green on it, then combining it with green color will give you no color.
---visit #directxdev on afternet <- not just for directx, despite the name
Here is all my OpenGL initialization code. I''m also using SDL, as u can see. I''ve already called SDL_Init(SDL_VIDEO); or whatever it is.

SDL_GL_SetAttribute( SDL_GL_DOUBLEBUFFER, 1 );
lpBackBuffer = new GUI_Surface;
lpBackBuffer->surface = SDL_SetVideoMode ( Settings.GetResWidth() , Settings.GetResHeight() ,16, SDL_OPENGL | SDL_GL_DOUBLEBUFFER | SDL_HWPALETTE ) ;



/* Enable smooth shading */
glShadeModel( GL_SMOOTH );
glEnable(GL_TEXTURE_2D);

/* Set the background black */
glClearColor( 0.0f, 0.0f, 0.0f, 0.0f );
glViewport(0, 0, 800,600);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();

glOrtho(0.0f,800,600,0.0f,-1.0f,1.0f);
glMatrixMode(GL_MODELVIEW);

This code is sort of sloppy cause I''ve been playing with it trying to get it to show green. GUI_Surface is something I made. Basically it has a pointer to an SDL_Surface and a GLuint for the texture.

This is the code that draws a simple triangle. Note the absence of green.

glBegin( GL_TRIANGLES ); /* Drawing Using Triangles */
glColor3f( 20.0f, 0.0f, 0.0f );
glVertex3f( 0.0f, 200.0f, 0.0f );
glColor3f( 0.0f, 20.0f, 0.0f );
glVertex3f( 0.0f, 0.0f, 0.0f );
glColor3f( 0.0f, 0.0f, 10.0f );
glVertex3f( 200.0f, 0.0f, 0.0f );
glEnd( );

Can anyone seen any problems with this code?
I like the DARK layout!

This topic is closed to new replies.

Advertisement