Spotlights: TREMENDOUS slowdowns

Bugs that have been investigated and resolved somehow.

Moderator: GZDoom Developers

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.
User avatar
Major Cooke
Posts: 8170
Joined: Sun Jan 28, 2007 3:55 pm
Preferred Pronouns: He/Him
Location: QZDoom Maintenance Team

Spotlights: TREMENDOUS slowdowns

Post by Major Cooke »

  • Download this.
  • Load MAP01, warp 1702 2096.
  • "give FlashlightToggle" in console.
  • Face the crates to the right and watch your computer curl up into the fetal position.
Yes, this is a stripped down version of the map, so ignore all missing entities and textures. They're not needed. I left all level geometry in there untouched -- didn't want to go screwing with that as that may affect testing performance.
User avatar
Rachael
Posts: 13530
Joined: Tue Jan 13, 2004 1:31 pm
Preferred Pronouns: She/Her
Contact:

Re: Spotlights: TREMENDOUS slowdowns

Post by Rachael »

This seems like a game sim processing issue. When the game is paused the frame rate issues go away.
User avatar
Major Cooke
Posts: 8170
Joined: Sun Jan 28, 2007 3:55 pm
Preferred Pronouns: He/Him
Location: QZDoom Maintenance Team

Re: Spotlights: TREMENDOUS slowdowns

Post by Major Cooke »

Holding still will increase FPS too. But not by much. Still if needed, it can be moved to somewhere more appropriate.
dpJudas
 
 
Posts: 3036
Joined: Sat May 28, 2016 1:01 pm

Re: Spotlights: TREMENDOUS slowdowns

Post by dpJudas »

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).
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49056
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: Spotlights: TREMENDOUS slowdowns

Post by Graf Zahl »

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.
User avatar
Major Cooke
Posts: 8170
Joined: Sun Jan 28, 2007 3:55 pm
Preferred Pronouns: He/Him
Location: QZDoom Maintenance Team

Re: Spotlights: TREMENDOUS slowdowns

Post by Major Cooke »

Huh... I guess spotlights have a smaller range then, in general?
User avatar
Caligari87
Admin
Posts: 6174
Joined: Thu Feb 26, 2004 3:02 pm
Preferred Pronouns: He/Him
Contact:

Re: Spotlights: TREMENDOUS slowdowns

Post by Caligari87 »

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-)
dpJudas
 
 
Posts: 3036
Joined: Sat May 28, 2016 1:01 pm

Re: Spotlights: TREMENDOUS slowdowns

Post by dpJudas »

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.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49056
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: Spotlights: TREMENDOUS slowdowns

Post by Graf Zahl »

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
dpJudas
 
 
Posts: 3036
Joined: Sat May 28, 2016 1:01 pm

Re: Spotlights: TREMENDOUS slowdowns

Post by dpJudas »

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?
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49056
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: Spotlights: TREMENDOUS slowdowns

Post by Graf Zahl »

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.
User avatar
Major Cooke
Posts: 8170
Joined: Sun Jan 28, 2007 3:55 pm
Preferred Pronouns: He/Him
Location: QZDoom Maintenance Team

Re: Spotlights: TREMENDOUS slowdowns

Post by Major Cooke »

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 40 times
Last edited by Major Cooke on Fri Jan 26, 2018 2:17 pm, edited 1 time in total.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49056
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: Spotlights: TREMENDOUS slowdowns

Post by Graf Zahl »

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?
User avatar
Major Cooke
Posts: 8170
Joined: Sun Jan 28, 2007 3:55 pm
Preferred Pronouns: He/Him
Location: QZDoom Maintenance Team

Re: Spotlights: TREMENDOUS slowdowns

Post by Major Cooke »

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 42 times
User avatar
Rachael
Posts: 13530
Joined: Tue Jan 13, 2004 1:31 pm
Preferred Pronouns: She/Her
Contact:

Re: Spotlights: TREMENDOUS slowdowns

Post by Rachael »

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.
Post Reply

Return to “Closed Bugs [GZDoom]”