View Full Version : Multiple light problem

06-03-2003, 04:30 AM
I need special ilumination for some objects in my scene. Each of these objects need their own light, and there are more objects than the maximun number of lights, so i thought i would do something like this:
-init scene parameters
-Place the light1 on Obj1
-Draw Obj1
-Place the light1 on Obj2
-Draw Obj2
... for all my meshes.
It doesnt work, so anyone knows if this lighting method is possible with OpenGL?
(I saw a multilight sample, but all the light movements and enables are made before all meshes are drawn)

06-03-2003, 06:00 AM

Your solution is perfectly ok for as long as the light belonging to an object doesn't need to affect the other objects. Can you explain exectly how it doesn't work, you've propably just made a mistake in the code.