Lighting!

Hello to all!

I’m new in this forum and I’m going to ask for something that I don’t know if it’s possible.

I’m developing a model viewer that loads a 3DS file and view it in a window. I have all the geometry, blending, texturing and viewing working, but I have a lot of problems getting realistic or at least convincing lighting.

I know that there is no master formula for lighting, but could you give me an aproximation for get something acceptable? If it’s usable, model materials are white plastic, glass and similars.

Thank you in advance.

Pedro, if you’re not familiar with the redbook, then I suggest that you check it out. It covers most every basic operation in OpenGL, among other things. You can buy it, or view the second edition online:

http://www.parallab.uib.no/SGI_bookshelves/SGI_Developer/books/OpenGL_PG/sgi_html/index.html

Here’s the chapter on lighting:
http://www.parallab.uib.no/SGI_bookshelves/SGI_Developer/books/OpenGL_PG/sgi_html/ch06.html

Once you are comfortable with the basics, you can take on task of lighting yourself, using vertex and fragment programs. But I would first read the entire redbook, carefully.