Diaz, on 27 October 2012 - 02:50 AM, said:
When taking lighting into account for performance, you must keep in mind that each light will cause every object and map geometry affected by it to be redrawn once. So basically, if you have 5 lights affecting 20 objects and complex geometry, those objects will be drawn 100 times and the geometry will be drawn 5 times, and that's what kills performance. Maybe the mechanisms at work aren't that simple but that's it roughly. If you want to keep a reasonable framerate, you can have a large amount of lights affecting simple geometry, or fewer lights affecting more complex geometry. Lowering shadow quality also helps a big deal with spotlights.
I've made a small app for my mod that uses sliders to allow the user to change r_pr_maxlightpasses, r_pr_shadows, r_pr_shadowdetail and r_pr_maxlightpriority in the .cfg, so performance is scalable. Full-blown lighting on my maps means both complex geometry and a large amount of lights seen at once, which requires a modern computer, so I had to do that.
There also seems to be some sort of bug/memory leak in Polymer that causes performance to drain as time passes. A restartvid in the middle of a game can sometimes double performance.
Thanks for the explanation. But if you disable spotlight shadows, then the lighting doesn´t look cool anymore. I´m not an expert but I think Polymer will always have a hard time when dealing with performance, because all lighting calculations are done on the fly. There should be a prebacked light system for static objects, on map startup (well nothing is 100% static in duke, but you know what i mean).