How to turn on/off light between 2D and 3D object

I write some source codes to draw using OpenGL.
Some entitis are 2D, others are 3D. Here is my sample codes:

//initial, light is on.

glDisable(GL_LIGHTING);

draw 2d entities.

glEnable(GL_LIGHTING);


draw 3d entites.

I found there is not shading on 3D entities, why? Could anyone give me some suggestions?

Moving to the beginners forum.

– Tom

Post your code which you are really using.

Are you sure you turn on proper lights?

The quick answer is to make sure you:

[ul][]Turn on appropriate lights (e.g. glEnable(GL_LIGHT0)[]Set light params appropriately. (e.g. glLight(…)[]Make sure you specify material settings (e.g. glMaterial(…)) []Make sure to specify normals appropriately. (e.g. glNormal(…))[/ul]

could also be a lack of tesselation, see #2

http://www.opengl.org/resources/features/KilgardTechniques/oglpitfall/

Thanks for hints, It is my program pitfall.