What causes dynamic lights to lag?

Bloodroke

L1: Registered
Jul 30, 2013
29
8
I have a large 4096x4096 DJ club; just a box, filled with pillars, TV's, etc. If need be, I can upload screenshots or a map copy to work with.

When I tested today with the lighting system in, the three lights that are in the center of the room cause severe framerate drops when one of them is turned on. All three are just regular lights with different colors that fill the whole room with light; they are strobe lights that activate when a button is pressed.

I have done as much optimization as I know how. All pillars, TV's, wall moldings, handrails, stairs, floor paths, wall pictures etc. are func_details. I have some areaportals set up in the spawn room doors to hide the particle emitters and miscellaneous objects in the player spawns when players aren't near them. I have used prop_statics on all the beams that hold the lights; the kind you would typically see in a DJ club. I have tried my best to make the map as even and nicely made as I could.

I have an AMD FX-8350 and a GTX 560 Ti Superclocked, so if I lag, I certainly notice it. If my PC dips into the "20" framerate range for a split second when the strobes turn on, I might possibly blow up other people's craptops or older desktops if they decide to play on the map, lol.

What exactly causes dynamic lights to cause so much lag? On an older version of the map I made, with the exact same strobes and similar room arrangements, albeit smaller, there was no noticeable lag on any clients I had test the map with me, and they had varying hardware, mostly on the crap end of the spectrum.

Is there anything I can do to eliminate the lag caused by the dynamic strobe lights other than just deleting them outright? I certainly can't release a craptastic lag-fest to the public, especially since the players on the server that I am making the map for expect this version to be perfect. The last one was made by a different person, and had no optimization whatsoever (you can probably guess how the framerate was on that map).
 

henke37

aa
Sep 23, 2011
2,075
515
So is it a named light entity or a light_dynamic entity? The first is just a lightmap variation and not that expensive. It's the light_dynamic that is a concern. It basically affects every single shader by adding additional work.
 

Bloodroke

L1: Registered
Jul 30, 2013
29
8
They seem to be just named light entities. The maker of the original map had them set to turn on or off to display different colors. He had two turn on at the same time to produce purple, for example. If these are calculated at compile time, why do they cause so much lag?

You see, I pretty much just copied and re-organized the lighting system the original creator had, as it was already pretty well made, except for being sloppily placed. I did however delete the loads of glowing light entities (can't remember what they were now) on his disco ball, as they actually caused severe framerate lag, and shot the pings of all the players on the server up by at least 50.
 

Bloodroke

L1: Registered
Jul 30, 2013
29
8
I apologize for the second shameless post in a row, but I figured out the problem.

I had multiple func_mirrors in the bathrooms. I didn't want to remove them despite their issues, but when I deleted them, map framerate increased massively, and other players testing on crappier PCs didn't lag.