PDA

View Full Version : Lighting on textured objects



Javac
08-06-2003, 12:41 AM
I'm a beginner in OpenGl programming and I'm working with Borland C++ Builder.
I would like to put some lighting on textured objects.Does OpenGL supports it?
I tried to setup lighting as for objects without texture,but there wasn't any effect.

roffe
08-06-2003, 01:10 AM
Originally posted by Javac:
I would like to put some lighting on textured objects.Does OpenGL supports it?


Yes. For OpenGL 1.1 texturing is applied after lighting which can create some strange looking results. Be sure to check out the "Separate Specular Color extension" which is included in OpenGL 1.2. You use it by changing the light model:
glLightModeli(GL_LIGHT_MODEL_COLOR_CONTROL,GL_SEPA RATE_SPECULAR_COLOR);



I tried to setup lighting as for objects without texture,but there wasn't any effect.

Nate Robins has good tutorials with source. Including one for lighting. http://www.xmission.com/~nate/tutors.html