GLLighting color problem
Whenever I enable lighting with glEnable(GL_LIGHTING) all the colors on my polygons dissappear and they turn white(with lighting though). I'm using Nehe code as my base. Does anyone know how I can fix that?
glEnable(GL_COLOR_MATERIAL)
Put that line in your setup code.
Put that line in your setup code.
That seems a random thing to suggest... I don't see how it can help.
A more obvious question to ask might be "do you have normals? and are they normalized?"
A more obvious question to ask might be "do you have normals? and are they normalized?"
He is saying that the lighting works, it's just that his colors all reset to white. That's consistent with what happens if you don't have color materials enabled, since it ignores the vertex colors and instead uses the material color. (which is white by default)
Ah, right. I was assuming "white" meant "white", as opposed to "varying shades of gray depending on the angle to the light"
Possibly Related Threads...
| Thread: | Author | Replies: | Views: | Last Post | |
| Problem with the graphics color on a videogame for iphone | femmedragon | 6 | 1,874 |
Dec 16, 2012 07:37 PM Last Post: SethWillits |
|
| ? Find color value of 'pixel' in color buffer? | Elphaba | 1 | 3,483 |
Jul 22, 2009 01:23 PM Last Post: Bachus |
|
| strange color problem | leggo | 12 | 4,941 |
Aug 27, 2004 08:36 AM Last Post: leggo |
|

