Graying of colours when lighting switched on

I’m trying to plot colour contours on a 3d model. It works fine with lighting off but with lighting on, all the colours turn to shaded gray. What do I need to do?

Hi !

It’s difficult to say, but one guess is that you try to use glColor() to set the color with lights enabled, glColor does not work with lights enabled, you must set the material colors, could that be the problem ?

Mikael

Try adding glEnable(GL_COLOR_MATERIAL).

Originally posted by gardi000:
I’m trying to plot colour contours on a 3d model. It works fine with lighting off but with lighting on, all the colours turn to shaded gray. What do I need to do?