Handling multiple lights

In my current project I would like to have more than 8 lights per level; to that end, if I understand correctly, I should either split the application of the lights amongst the objects such that only a subset affect each object, or use deferred lighting.

At the moment I’m inclined to the first solution - for one thing, I’m hoping to keep my system requirements low, and for another my current system doesn’t seem to run the firefly sample properly, suggesting that developing on this system a game that uses deferred lighting might be a poor idea.

So, my first question: does anyone have any counter-arguments to my thinking above? Have I missed an argument in favour of using deferred lighting, or another option for the application of numerous lights? (Or perhaps a compelling reason to not use numerous lights?)

My second question is this: Does the below system look like a reasonable implementation? I have a fear that I’m missing something…

The system that I have in mind:

First, I’ll note that my game, while using 3D assets, essentially plays in 2D.

My thought is to keep a 2D array, each cell of which holding references to the lights that might be expected to affect objects in that cell. As each object moves, its coordinates are checked, and if it has crossed a cell boundary its lights are removed and those referred to in the new cell are set for it. Note that a single light might be referred to by multiple cells.

Background geometry would be modelled in pieces (or modelled as one piece and then manually cut into appropriate sizes); these pieces would then have their lights assigned at startup.

(A sub-question: is there a tool to automatically cut up such background geometry, perhaps?)

Moving and transient lights might be handled by storing in each cell the objects currently in that cell and, for each frame, checking the coordinates for each such light and, for any that have crossed a cell boundary, removing the light from objects in the previous cell and applying it to those in the new cell. This does, however, feel worryingly circular to me…

On the plus side, such a cell system could also provide me with some broad-phase culling for a few logic checks that I’d like to perform.

So, what opinions or advice does anyone have on this?


On a side note, does anyone have or know where I might find benchmark framerates for any of the sample programs? I’d like to have some idea of how much of my framerate issues are attributable to my system (which I suspect is somewhat poor, especially on the graphics side).