Advertisement

glColorMaterial and lighting

Started by September 19, 2002 04:07 AM
2 comments, last by adema 22 years, 5 months ago
i use lighting in my program and if put this two lines of code into rendering code suddenly lighting doesn''t seem to work any more. IMHO this two lines shouldn''t have any effect on anything if they''re called in this order and there''s no code between them. glEnable(GL_COLOR_MATERIAL); glDisable(GL_COLOR_MATERIAL);
I remember to have dealt with it few months ago. You''re wrong when you think it "shouldn''t have any effect on anything if they''re called in this order and there''s no code between them".

Darn, the search feature is broken. Please give me a few minutes to find the topic again.
Advertisement
Ah, There it is ! Nothing replaces a good''ol brain

At the exact moment when you call glEnable(GL_COLOR_MATERIAL), OpenGL affects the last know color (defined by glColor) to the last known material (defined by glColorMaterial).

That''s why calling glEnable(GL_COLOR_MATERIAL) DOES CHANGE SOMETHING even if you think that disabling it immediately would keep it safe.
thx for the link. much better than the documentation on msdn ;-)

This topic is closed to new replies.

Advertisement