lighting questions / strategies


new to opengl and was thinking about the lighting. With the limit of for example 8 gl lights, what are the “best practices” when dealing with big overview scenes for example new york city from above. with alot of light sources.

do you just fake it with changing textures around the light sources, and as you move in closer, make only the lights closest to the viewport become real opengl lights?

Or do you roll your own light entirely from scratch?

Thanks in advance

As you understood, basic opengl hardware lighting does not scale well with the number of lights.
Typically games udes precomputed lighting for the whole static scene, applied as texture mapping. For dynamic objects, only the nearest n lights are taken in account (each object can have its own lights).

Other way of doing is is defered shading approach : need more modern hardware, it has quite an important fixed cost, but scales well with the number of lights.
Look at this this thread for interesting info and demo+code :


thank you for the prompt reply! I have read up on these various aspects, but i think they were abit over my head for now.

Are there any thoughts on precompiled lighting when dealing with an environment that is changing alot, for example back to new york - cars moving along the roads, boats in the harbor and this reflecting on the buildings, streets and other objects.

I guess rolling our own lighting sounds like the only realistic approach for keeping lighting “under control” at this point.