• Advertisement

Archived

This topic is now archived and is closed to further replies.

lighting

This topic is 6211 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I am working on getting lighting to work with one of my programs, and failing. To try to see what was going wrong, I grabbed the lighting demo from nehe's site and started modifying. I compiled it, and the lighting worked as expected. Then, I cut out the texture loading and texture coordinates, and replaced them with glColor3f(1.0f,1.0f,1.0f) just before the glBegin() for making the cube, right where the texture bind function was. I would expect some kind of white cube being lit in some cool fashion, but instead it is very dark green. Can anyone explain this? Update: I guess nobody cares, but I also have found that the supposedly white cube is a different color depending on whether the program is run fullscreen or in a window. It's rather tan windowed, but when it's running in fullscreen mode it is very dark green. Can someone please explain what is going on? Edited by - tsuraan on February 14, 2001 6:56:59 PM

Share this post


Link to post
Share on other sites
Advertisement
Guest Anonymous Poster
Questions about lighting is very difficult since you have so many variables to set. It sounds like one of the variables is set to a pretty random value.

It is pretty much to expect that someone should try to guess what lighting demo you mean and load that in a editor and try to do the same changes.

Share this post


Link to post
Share on other sites
The demo is nehe's lesson 7, lighting, texture binding, and other stuff. Starting from line 159, I simply commented out the glBindTexture and all subsequent glTexCoord2f's. Under where I commented out the texture binding, I added glColor3f(1.0,1.0,1.0). I would expect that this would give me a generally white cube rotating under white light (the light wasn't changed from the demo at all).

Having commented out any reference to a texture, I am now getting a white cube in windowed mode, but a nice, aqua blue in fullscreen. this is very odd. Maybe it's just 'cause my graphics card and drivers suck. Still, some explanation from a knowledgable source would be cool.

Any ideas?

Edited by - tsuraan on February 17, 2001 7:56:14 PM

Share this post


Link to post
Share on other sites
okay, after considerable playing around, I finally changed the color depth from 16 to 24, and everything is happy now. I''d still love some kind of explanation of this, if anyone has any ideas.

system:
ATI M1 mobility
Windows 2000

Share this post


Link to post
Share on other sites
I''ve had a similar problem, when I colored my objects and switched on lighting, the where grey, and not colored as I expected.
I played a little bit around and searched the help, and eventually I get it work using
glEnable(GL_COLOR_MATERIAL); // in GLSetupRC()
I don''t really know what it does, but in my prog it worked. I can''t explain why it worked for you without this function in 24 bit mode. (I use 24 bit mode too (if this is what is set in the PIXELFORMATDESCRIPTOR handed to ChoosePixelFormat())).
Try to enable GL_COLOR_MATERIAL in 16 bit mode and tell me your result, I''m curios about it.

System: Windows98 Vodoo3 2000

Greetings Ben

Share this post


Link to post
Share on other sites
I haven''t looked at the code from the tutorial, but there''s a good chance you still have texturing turned on. Try doing a glDisable(GL_TEXTURE_2D) and see if that solves it.

Share this post


Link to post
Share on other sites
neither of these had any effect. The 16-bit color still shows white as a aqua-blue, trying either of these settings or both. 32-bit color works great without these, or with them. Strangs...

Share this post


Link to post
Share on other sites

  • Advertisement