Advertisement

Only eight lights?

Started by May 23, 2003 08:48 PM
3 comments, last by Emon 21 years, 9 months ago
In all the tutorials and articles I''ve read, they''ve said you can only have eight lights... so what if I want more than eight lights? What are some ways around this still using the standard OpenGL lighting, or do I have to create something new?
*grumble*
This question has been posed, well, 1.000.000.000.000 times before, approx.

You don't want to use 8 lights *simultaneously* over a single object at a time. And if it is the case, just select the eight most important lights for the object you're rendering. You won't notice the contribution of the other lights anyway.

For instance, if you're rendering a building with 100 rooms and 100 lights (one light per room), you will not need the 100 lights simultaneously for a single object because walls and doors do stop the light contribution. When rendering a chair in a room, this chair will be lighted by the light in the room, and maybe the lights of neightbouring rooms, and possibly the light from the window, where in total 4-5 lights do give a significant contribution. But definately you're not likely to reach an ammount of 8 lights !

Take a look at the FAQ at www.opengl.org as well as other articles that you can find with google. It's a very common topic.


[edited by - vincoof on May 23, 2003 10:02:02 PM]
Advertisement
Yes, I apologize for having to post. I tried to use the search function many times, but it''s functionality appears to be sporadic at the moment.

I''m currently looking into other methods for lighting since the idea of being limited to eight lights is absolutly rediculous to me.
No need to apologize. You''re not the first one ... and neither you are the last one !

What you have to know is that 8 lights is the limit for every polygon, say every "3D model" (even though it has no real meaning in OpenGL). Every time you render an object, you have to know which are the lights that contribute to the coloration of this object, and you have to setup and enable the corresponding lights.

One other thing : lighting is very slow. Most games uses only one light (generally, the sun contribution for outdoor scenes, the closest lamp for indoor scenes) and fake the rest of the lighting effects with textures and/or lightmaps. Lots of graphics cards do only accelerate one or two lights ! You should really consider that.
Hmm, I will, thanks.

This topic is closed to new replies.

Advertisement