Is there a way to have more lights in the scene than the standard 0-7? In the Red Book is explained that the number of light sources may vary depending on the particular implementation. But that''s not what I mean. So, is there a way to have more than 7 lights? For example, 20?
Thx
Drag0n
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the universe trying to build bigger and better idiots. So far, the universe is winning..."

Well, you should be a bit more creative and do it with a max of eight lights, you could do the following: make your 3D engine/level design so that you can see no more than eight lights at the same time. Make your own light class and copy its parameters onto the OpenGL standard lights that are visible...Or you can do this (a lot harder): Make an omni light (say LIGHT0 or something) and let it be the sun (place it high, huge attenuation, etc) and precalculate the shadows and map them over the scene, if you need any RT lights use the other seven...

I''ve been thinking about this kind of stuff a lot lately... Here are my two.. or three... or maybe even four cents.

- First of all, I wouldn''t recommend going above the 8 light limit that OpenGL provides. You risk some slowdown on cards that don''t support more than those 8 lights.

- Second of all... Why use OpenGL''s DYNAMIC hardware accelerated lights for lighting a static scene? Its craziness I tell you. Generate a radiosity solution, or lots of light/attenuation maps, and light the freaking scene!

- I would strongly suggest making a singleton OpenGL hardware light manager (to manage the 8 available lights that you are almost guaranteed), and use those lights for things that are completely dynamic (like lighting a missle trail) and such. And then use lightmaps for things such as, sun coming through a window, ceiling lights, etc.

I am doing research on all the types of lighting available right now, I will then weigh each types pros and cons. Then work on an implementation for my engine... Once thats done I''ll work on a nifty tech demo, and write a nice long tutorial on everything I learned, and implementating light!

after many hours of searching, i still couldnt find the link i wanted. damn flipcode changing everything around. it basically went like this (i think).

you have 8 lights to play with. instead of using 8 lights for the whole scene, use 8 lights per object (how you define an "object" is up to you). when you come to render the object, enable the 8 lights that are closest to it, and render the object. then move onto the next object, enable the 8 lights that are closest to that object, render, and repeat.

it doesnt matter what order you plug your lights into the GL_LIGHTi definitions. example:

// Now sort the distance values from lowest to highest.
// when swapping values about, remember to swap the LightID
// values too, example:
//
// LightDis[3] = LightDis[4];
// LightID[3] = LightID[4];
//
// that way we know that the 5th light (remember we start
// at zero) is now located in the 3rd position.

What I suggest is writing a static vertex-shader light class,then have a dynamic ogl light class.Thats what I think I am going to end up doing.I`ve already got a fairly simple OGL light class.I can send you the code and help you out if you like ~V''lion

I know only ATi Radeon and above can do it at a reasonable speed (i own a radeon), but i have no idea how to implement it...It looks a WHOLE lot better than per vertex lighting...so maybe it''s worth implementing...(i am not sure though how many light sources it allows..but because it works on texture space, it may be a lot more than 8...i might be wrong though)

(can anyone PLEASE point me to how to do that? iv''e been looking for a long time and all i found was DOT3 bump mapping (which is also a way of per pixel lighting, but I wanna know how to do the lighting itself..not bumpmapping...)PLEASE help if you can.

This question has popped up a few times on these boards before.MENTAL pretty much nailed it. You never need more than 8 lights on one particular mesh, in fact, 8 is usually too much because of the huge slowdown you get with multiple lights. For instance, FPS with 8 lights is usually about 10% of that with 1 light. If you really feel you need 8 lights acting on a particular polygon, use static lightmaps or devise your own software lighting solution (as in Quake2).