point_spotlight discussion
Post Reply
Quote
Re: point_spotlight discussion
Posted by RadiKal on Fri Jan 7th at 8:50am 2005


Ok I posted about 2 weeks ago complaining that my frame rate was suffering. I thought that the problem was that I had a large pile of func_physboxes and that all my brushes collided, causing the compiler to need to chop up all the brushes. This, I thought, was my problem and I tried using areaportals and such to fix the lag. Well, none of it worked, but at least I cleaned up my map a bit by making sure the brushes don't intersect any more After more investigation I found that the major culprits are my point_spotlights. Originally I had about 10 point_spotlight entities in my map, and my fps was about 10 (keeping in mind I have a 1.67 Ghz, 512 mb ram, geforce 5700) when I was looking at the area with the highest concentration of the lights. This includes being on a completely other side of the map with two huge canyon walls in between the point_spotlights and I. Shortening the lights didnt' do any good, and neither did removing half the lights. Normally (without the spotlights) I managed 30 to 50 fps. Upon more experimentation I found that with only 1 point_spotlight in the map, I got 20 fps when in or looking at the light and 30 to 40 when not looking at it. Thus, I figured the point_spotlights are my problem and came here to see if anyone knew what I could do that would allow me to use the spotlights without having a huge hit for fps. They are rather essential to the map (since the map is based at night). The spotlights are not all in the same room, so if there was some way to "contain" their effect on fps so that the frame rate would only take a hit when you were inthat room, it would be acceptable... I'm thinking there must be a way to do it because in de_prodigy there are the hanging lights in ct spawn, but I dont' suffer any real fps drop there. thanks!





Quote
Re: point_spotlight discussion
Posted by Yak_Fighter on Fri Jan 7th at 9:14am 2005


I highly doubt the point_spotlights are causing you framerate drops. I've got a ton of them in my map and they create like a 1-2 fps hit at max. You can test this by going into your map and entering into the console sv_cheats 1 and r_drawbeams 0. You've just turned off all the point_spotlights in your map. Now by turning them off and on you can see how large a dent they make in your framerates.

If they really are the culprit, then I guess you'll have to just use regular glow sprites and increase the intensity of those lights.

[addsig]




Quote
Re: point_spotlight discussion
Posted by Paladin on Fri Jan 7th at 1:50pm 2005


Point_spotlights can be real resource hoggers. Remember to switch of dynamic lightning in the flags section of the entity. Dynamic lightning is not very well implemented in source and thus can result in a huge framerate drop. Try to use at maximum one dynamic light per screen and never use more.
With dynamic lightning switched off you can use a lot more point_spotlights.




Quote
Re: point_spotlight discussion
Posted by Leperous on Fri Jan 7th at 3:31pm 2005


Type +showbudget into the console, and it'll *probably* tell you what's going wrong.

I had a similar problem with my map- the FPS would drop really low in quite a simple area, and the only thing around were displacement surfaces, spotlights and a couple of models. My advice would be to remove different things and recompile to see what's going on; if your "two huge canyon walls" are built with displacement surfaces I would try removing them first as this is what was causing problem in one of my rooms (lowering the power of it seemed to help).





Quote
Re: point_spotlight discussion
Posted by RadiKal on Sat Jan 8th at 10:48pm 2005


Wow, huge performance difference Thanks to all three of you! I never expected that the showbudget command would be so helpful. First thing I saw when i popped it up was that my dynamic lighting was all the way to the right and never even dropped. I switched that flag for no dynamic lighting on for all the point_spotlights and now the dynamic lighting is way down and my fps never go below 30. Thanks everyone!



Quote
Re: point_spotlight discussion
Posted by Leperous on Sat Jan 8th at 10:58pm 2005


The 'no dynamic light' flag on point_spotlights saved my life too!



Quote
Re: point_spotlight discussion
Posted by satchmo on Sun Jan 9th at 6:01am 2005


Same here. The frame rates increased by 10 to 20 in most places.

Even after I turned dynamic light off on point_spotlights entities, I did not notice anything differently about the appearance of my light beams. So the question is, when is it necessary to leave dynamic lighting on for these entities? It seems like that there's no real reason to leave it on, in any situation.
[addsig]




Quote
Re: point_spotlight discussion
Posted by Joe-Bob on Sun Jan 9th at 6:16am 2005


Well, would it light up a player or prop that got in its path? It might look kinda strange if they didn't get lit at all.




Quote
Re: point_spotlight discussion
Posted by mazemaster on Sun Jan 9th at 8:35am 2005


Just wanted to pipe in agreement that +showbudget is a godsend. [addsig]



Quote
Re: point_spotlight discussion
Posted by RealEschaton on Sun Jan 9th at 9:21am 2005


? quoting satchmo
Same here. The frame rates increased by 10 to 20 in most places.

Even after I turned dynamic light off on point_spotlights entities, I did not notice anything differently about the appearance of my light beams. So the question is, when is it necessary to leave dynamic lighting on for these entities? It seems like that there's no real reason to leave it on, in any situation.

I think it only matters if you want the point_spotlight to be able to move around, sort of like the hanging lights at CT spawn in the Source de_prodigy. Turing dynamic lighting off means the light is treated as a normal spotlight, with its data used by vrad to determine the overall lighting scheme. Leaving it on means that the lighting must be recalculated at every frame (or close to it... in maps that I had dynamic lights in the amount of time spent on lighting seemed to vary wildly).





Quote
Re: point_spotlight discussion
Posted by RadiKal on Sun Jan 9th at 11:46am 2005


Actually, I did notice one thing when I switched the dynamic lighting flag. My spotlights are pretty long, and before, the ground spotlighted would be much lighter than the area around (much moreso than just the light_spotlight behind it) When I turned off the dynamic lighting, the ground wasn't illuminated any more (or any models or anything). The beam and glare effect are still there though, which is what I really wanted in the first place. I just upped the brightness of the light_spotlights to compensate for the loss of the extra illumination. Also, I'm looking into just placing some sort of decal on the ground to make it lighter (can this work?)



Quote
Re: point_spotlight discussion
Posted by Orpheus on Sun Jan 9th at 12:28pm 2005


? quoting Leperous
The 'no dynamic light' flag on point_spotlights saved my life too!

1)if its such a killer, what is its intended purpose used for?

2)what exactly (other than frame drops) does one do and the other do when you alter that specific setting?

3)how does it look ingame for each?

[edit] before some gripes, the case is closed, and its 3 inquiries about 1 question.

[addsig]




Quote
Re: point_spotlight discussion
Posted by Leperous on Sun Jan 9th at 5:55pm 2005


Without that flag ticked I think it actually lights things up; presumably as it has a 'parent' field it's categorised under dynamic lighting. It's there because I can imagine you'd want these in low-poly areas, though unticking this flag doesn't change appearance if you have a light_spot in the smae place anyway!




Post Reply