How to make shading effect in OpenGL?

Have any library function?

Hi !

Maybe a little bit more details would help here, the word “shading” can be interpredted in a number of ways, so if you could explain what you need it for, then it would be much more easy to help you out.


i just want to do something follows:
there is a light source,an object,and i
need draw a projection of the object on
a plane.

Ok, you want shadows, OpenGL does not have any built in support for it, but there are a lot of ways to do shadows, if you want simple shadows (just projections on a plane), they are pretty easy to do.

If you have a look at this website you will find a number of references to examples with shadows, I also belive that on eof the NeHe tutorials is about shadows two.

You can alsways make a search on google for “shadows” and “opengl”.