[Can't fix] Spotlights: TREMENDOUS slowdowns

Bugs that have been investigated and resolved somehow.

Moderator: GZDoom Developers

Spotlights: TREMENDOUS slowdowns

Postby Major Cooke » Thu Jan 25, 2018 9:58 pm

  • 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
Major Cooke
Do unto others as you would have unto you. Judge yourself first.
 
Joined: 28 Jan 2007

Re: Spotlights: TREMENDOUS slowdowns

Postby Rachael » Fri Jan 26, 2018 12:10 am

This seems like a game sim processing issue. When the game is paused the frame rate issues go away.
User avatar
Rachael
Webmaster
 
Joined: 13 Jan 2004
Discord: Rachael#3767
Twitch ID: madamerachelle
Github ID: madame-rachelle
Graphics Processor: nVidia with Vulkan support

Re: Spotlights: TREMENDOUS slowdowns

Postby Major Cooke » Fri Jan 26, 2018 12:59 am

Holding still will increase FPS too. But not by much. Still if needed, it can be moved to somewhere more appropriate.
User avatar
Major Cooke
Do unto others as you would have unto you. Judge yourself first.
 
Joined: 28 Jan 2007

Re: Spotlights: TREMENDOUS slowdowns

Postby 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).
dpJudas
 
 
 
Joined: 28 May 2016

Re: Spotlights: TREMENDOUS slowdowns

Postby 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.
User avatar
Graf Zahl
Lead GZDoom Developer
Lead GZDoom Developer
 
Joined: 19 Jul 2003
Location: Germany

Re: Spotlights: TREMENDOUS slowdowns

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

Huh... I guess spotlights have a smaller range then, in general?
User avatar
Major Cooke
Do unto others as you would have unto you. Judge yourself first.
 
Joined: 28 Jan 2007

Re: Spotlights: TREMENDOUS slowdowns

Postby 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-)
User avatar
Caligari87
I'm just here for the community
User Accounts Assistant
 
Joined: 26 Feb 2004
Location: Salt Lake City, Utah, USA
Discord: Caligari87#3089

Re: Spotlights: TREMENDOUS slowdowns

Postby 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.
dpJudas
 
 
 
Joined: 28 May 2016

Re: Spotlights: TREMENDOUS slowdowns

Postby 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
User avatar
Graf Zahl
Lead GZDoom Developer
Lead GZDoom Developer
 
Joined: 19 Jul 2003
Location: Germany

Re: Spotlights: TREMENDOUS slowdowns

Postby 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?
dpJudas
 
 
 
Joined: 28 May 2016

Re: Spotlights: TREMENDOUS slowdowns

Postby 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.
User avatar
Graf Zahl
Lead GZDoom Developer
Lead GZDoom Developer
 
Joined: 19 Jul 2003
Location: Germany

Re: Spotlights: TREMENDOUS slowdowns

Postby 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 16 times
Last edited by Major Cooke on Fri Jan 26, 2018 2:17 pm, edited 1 time in total.
User avatar
Major Cooke
Do unto others as you would have unto you. Judge yourself first.
 
Joined: 28 Jan 2007

Re: Spotlights: TREMENDOUS slowdowns

Postby 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?
User avatar
Graf Zahl
Lead GZDoom Developer
Lead GZDoom Developer
 
Joined: 19 Jul 2003
Location: Germany

Re: Spotlights: TREMENDOUS slowdowns

Postby 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 17 times
User avatar
Major Cooke
Do unto others as you would have unto you. Judge yourself first.
 
Joined: 28 Jan 2007

Re: Spotlights: TREMENDOUS slowdowns

Postby 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.
User avatar
Rachael
Webmaster
 
Joined: 13 Jan 2004
Discord: Rachael#3767
Twitch ID: madamerachelle
Github ID: madame-rachelle
Graphics Processor: nVidia with Vulkan support

Next

Return to Closed Bugs

Who is online

Users browsing this forum: Awario [RSS] and 1 guest