Performance problems with multiple transient lights

I’m using an explosion class which creates its own point light, sets it on render, and removes it when the explosion is over. As more such explosions (say 10) are started in the same frame, there is a noticable stutter in that frame, though framerate is generally holding. If I enable shaders (just setAutoSharder()) on the node surrounded by these explosions, then the framerate takes huge drop while explosions are running (like from 60 fps without shaders to below 10 fps with). If I set explosions not to light render, but only the node surrounded by them, then the stutter on creation is gone, but the framerate drop with shaders enabled is still the same. (That node has about 6000 polys.)

Is this expected behavior for how I’m using lights, or is there something wrong? If it’s expected, is there a common way to visually approximate the desired effect?

(The hardware I’m using is generally up to date. Panda 1.6.2.)

The hardware limit tends to be 8 lights for the current rendering model so you’ll be bound to get some punishment after exceeding that. You could try studying the Fireflies sample on how to use more lights through deferred shading.

Would that be 8 lights of any type, including also e.g. ambient lights?

If I understood correctly the accompanying text to Fireflies sample, if I want many lights, I have to go for shaders? And the limit without shaders would be these 8?

That’s right. The deferred method should be included as a part of the default rendering pipeline eventually, but I wouldn’t hold my breath while waiting for it. So for now, you’ll have to do it the hard way like in the sample :cry:

Darn; but at least now I know the deal :slight_smile: Thanks!