Spotlights: TREMENDOUS slowdowns

Forum rules
Please don't bump threads here if you have a problem - it will often be forgotten about if you do. Instead, make a new thread here.

Post a reply

Smilies
:D :) :( :o :shock: :? 8-) :lol: :x :P :oops: :cry: :evil: :twisted: :roll: :wink: :geek: :ugeek: :!: :?: :idea: :arrow: :| :mrgreen: :3: :wub: >:( :blergh:
View more smilies

BBCode is OFF
Smilies are ON

Topic review
   

Expand view Topic review: Spotlights: TREMENDOUS slowdowns

Re: Spotlights: TREMENDOUS slowdowns

by Graf Zahl » Fri Jan 26, 2018 3:38 pm

All of this won't probably solve the problems here - only reduce them.

Re: Spotlights: TREMENDOUS slowdowns

by Major Cooke » Fri Jan 26, 2018 3:22 pm

Should this be re-opened then?

Re: Spotlights: TREMENDOUS slowdowns

by Graf Zahl » Fri Jan 26, 2018 2:55 pm

Obviously this also means that changing the aperture will necessitate relinking, i.e. the spotlight properties need to be made readonly and settable through a function to ensure it works as intended.

Re: Spotlights: TREMENDOUS slowdowns

by Rachael » Fri Jan 26, 2018 2:43 pm

Yeah Cooke is right - only static portals will transfer dynamic lights, and static portals can only face the same direction as their origin. So you can safely clip away everything that's too far out of the spotlight's aperture and it'll still be portal-safe.

Re: Spotlights: TREMENDOUS slowdowns

by Major Cooke » Fri Jan 26, 2018 2:13 pm

It does this with shadowmapping turned on. Turned off, it behaves normally.

EDIT: It's the same for both sides so it depends on the hidden room's depth. Huh...

EDIT 2: Forgot to attach the updated portals.wad. I only changed the two lines directly though, I didn't bother with the rest of them.
Attachments
portals.wad
(50.04 KiB) Downloaded 49 times

Re: Spotlights: TREMENDOUS slowdowns

by Graf Zahl » Fri Jan 26, 2018 2:11 pm

That should make this here a bit easier.
Now I remember why I left them out. Getting the links is not the issue - the real problem is to get the proper location for the light after the portal transformation because this requires the offset table that's only available for static portals.

But here's another question that just came up. How does the shadowmap handle portals if some linedef is between the relocated light and the area affected through the portal?

Re: Spotlights: TREMENDOUS slowdowns

by Major Cooke » Fri Jan 26, 2018 2:04 pm

Only for Static (Eternity style) portals does the GL lights transfer over. In this example the lines are not static.
Attachments
portals.wad
(50.04 KiB) Downloaded 42 times

Re: Spotlights: TREMENDOUS slowdowns

by Graf Zahl » Fri Jan 26, 2018 1:51 pm

I knew these arbitrarily angled portals were a bad idea from the start but imagine I had removed them. Can you imagine how people might have reacted...? :twisted:

It should be doable, though. If these portals are handled (I cannot remember if I skipped them), the light needs repositioning anyway so doing the needed rotation as well shouldn't be the issue.

Re: Spotlights: TREMENDOUS slowdowns

by dpJudas » Fri Jan 26, 2018 1:28 pm

Graf Zahl wrote:What you definitely can do is to stop at segs which are completely outside the cone, provided that this can be done quickly.
That's what I had in mind, but the angles you check for changes if the seg it crosses is a portal. Not an unsolvable problem, but I didn't feel like attacking it at the time. :)

Edit: or hmm, does it?

Re: Spotlights: TREMENDOUS slowdowns

by Graf Zahl » Fri Jan 26, 2018 1:23 pm

What you definitely can do is to stop at segs which are completely outside the cone, provided that this can be done quickly.

Anyway, if you got an idea how to improve performance of creating all the light lists, be my guest.
The algorithm was originally from ZDoomGL, although that original was even more inefficient that what's there now.
In the end this is just one of those things where the Doom engine does not mix well with modern rendering effects

Re: Spotlights: TREMENDOUS slowdowns

by dpJudas » Fri Jan 26, 2018 1:06 pm

That's correct, Caligari87. However due to portals I didn't feel comfortable trying to improve the light link function without having a 100% understanding of how it links. This kind of function is not one you want to break by doing something careless.

Re: Spotlights: TREMENDOUS slowdowns

by Caligari87 » Fri Jan 26, 2018 1:03 pm

The performance impact is actually the same as a normal dynamic light but the radius needs to be much higher to appear visually right because we expect spotlights to reach farther than point lights. The problem is that spotlights still "look all around" for affected linedefs even if they generally only illuminate a small portion of them.

I presume the fix would require only looking for linedefs that coincide with the light's cone.

8-)

Re: Spotlights: TREMENDOUS slowdowns

by Major Cooke » Fri Jan 26, 2018 12:58 pm

Huh... I guess spotlights have a smaller range then, in general?

Re: Spotlights: TREMENDOUS slowdowns

by Graf Zahl » Fri Jan 26, 2018 11:07 am

That light is wayyyyyy too large for the engine to handle efficiently. With a map this detailed the subsector linking for each movement will take its toll.

Re: Spotlights: TREMENDOUS slowdowns

by dpJudas » Fri Jan 26, 2018 1:01 am

I'm willing to wager that this also happens with normal lights and that you're using moving a light around with a very large radius (don't have time to look at the mod right now).

Top