PDA

View Full Version : smooth lighting???



iNsaNEiVaN
04-15-2001, 09:29 AM
I know opengl uses gourad lighting so one polygon only gets one lighted color. So how would you do smooth lighting like in plate 24 (pictures) of the red book? (like the light in the basement)

Dodger
04-16-2001, 04:20 AM
Try glShadeModel(GL_SMOOTH);

I believe by default the shade model is GL_FLAT, so yes, one polygon gets only one color. With GL_SMOOTH the colors are interpolated between the vertices.

mango
04-16-2001, 07:49 PM
Gourad lighting means that the lights are interpolated between the vertices but all OpenGL implementations must support at least 8 lights. The lower limit is 8 lights for each polygon and not one.

How to do smooth lighting is a big and difficult question. If you have many small polygons will the standard OpenGL lights look good. Check out the nvidia developer pages for lots of information about this. The new, cool way is by using vertex programs.