Fractal Softworks Forum

Please login or register.

Login with username, password and session length
Advanced search  

News:

Starsector 0.97a is out! (02/02/24); New blog post: Simulator Enhancements (03/13/24)

Author Topic: Targeting feed tanks FPS  (Read 744 times)

dreamdancer

  • Ensign
  • *
  • Posts: 18
    • View Profile
Targeting feed tanks FPS
« on: May 27, 2021, 09:34:36 AM »

The only mod that's installed is Console Commands / Lazylib.

The test setup is a Heron against an Eagle in the simulator. With some fighters like Broadsword, performance is perfectly fine at 60 FPS. With Lux, FPS tanks to 10 FPS, as soon as targeting feed is activated. FPS remains low, even when fully zoomed in and no fighter is visible. It also remains low, when the game is paused.

I tried modifying "TargetingFeedStats.java". Removing the 'setJitterUnder' and 'setJitter' calls fixes the performance problems.

(Platform is Linux, GPU is AMD RX480 with Mesa 21.03 and Kernel 5.12.)
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 23986
    • View Profile
Re: Targeting feed tanks FPS
« Reply #1 on: May 27, 2021, 09:47:15 AM »

Thank you for the report!

Are you sure the FPS remains bad when no fighters are on-screen? They'd have to be a little ways offscreen to not render at all, btw - not by a lot. For the sake of testing, though, having the screen be say a half-screen away from the nearest fighter would ensure they're not rendered. It's just odd for the "jitter" calls to be affecting performance when the fighters are offscreen since they'd generally not be rendered then.

It's also strange that there'd be a difference between the Broadsword and the Lux - unless the Lux have their shields up, I don't think there'd be any meaningful difference. Hmm.

Regardless, though, unfortunately this looks like a driver performance issue. It's just not doing *that* much more work for the jitter effect, so I suspect it has something to do with how the card is handling transparency/blending or some such. My apologies - I don't think there's much I can really do about this on my end.
Logged

Sutopia

  • Admiral
  • *****
  • Posts: 1005
    • View Profile
Re: Targeting feed tanks FPS
« Reply #2 on: May 27, 2021, 03:00:20 PM »

Thank you for the report!

Are you sure the FPS remains bad when no fighters are on-screen? They'd have to be a little ways offscreen to not render at all, btw - not by a lot. For the sake of testing, though, having the screen be say a half-screen away from the nearest fighter would ensure they're not rendered. It's just odd for the "jitter" calls to be affecting performance when the fighters are offscreen since they'd generally not be rendered then.

It's also strange that there'd be a difference between the Broadsword and the Lux - unless the Lux have their shields up, I don't think there'd be any meaningful difference. Hmm.

Regardless, though, unfortunately this looks like a driver performance issue. It's just not doing *that* much more work for the jitter effect, so I suspect it has something to do with how the card is handling transparency/blending or some such. My apologies - I don't think there's much I can really do about this on my end.

Maybe add a jitter effect toggle in settings?
Jitter helps identify danger but it’s duplicating sprite to achieve the effect and they are only rendered for a extremely short amount of time. The constant adding and removal may be causing the issue - Im no expert nor have I looked into the implementation so I may be wrong.
Logged


Since all my mods have poor reputation, I deem my efforts unworthy thus no more updates will be made.

dreamdancer

  • Ensign
  • *
  • Posts: 18
    • View Profile
Re: Targeting feed tanks FPS
« Reply #3 on: May 28, 2021, 08:04:00 AM »

Are you sure the FPS remains bad when no fighters are on-screen? They'd have to be a little ways offscreen to not render at all, btw - not by a lot.

I tried that. Frame rate recovers when they are way, way off screen. Almost the entire allowed camera move distance is required.

Quote
It's also strange that there'd be a difference between the Broadsword and the Lux - unless the Lux have their shields up

They do.

Quote
It's just not doing *that* much more work for the jitter effect

In that simulator test, there are something like 26000 OpenGL calls per frame without targeting feed. There are 70000 with targeting feed active.

Anyway, I tried Zink OpenGL, which is an OpenGL implementation running on top of Vulkan. That does resolve the performance problem and things run at 60 FPS. For anyone who wants to try that, you need to set the "MESA_LOADER_DRIVER_OVERRIDE=zink" environment variable.
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 23986
    • View Profile
Re: Targeting feed tanks FPS
« Reply #4 on: May 28, 2021, 10:43:35 AM »

I tried that. Frame rate recovers when they are way, way off screen. Almost the entire allowed camera move distance is required.

Thank you for giving that a try - huh, that's very odd as well...

Quote
It's just not doing *that* much more work for the jitter effect

In that simulator test, there are something like 26000 OpenGL calls per frame without targeting feed. There are 70000 with targeting feed active.

Right, that sounds reasonable. But not all OpenGL calls are created equal! Performance-impact-wise, this *should* be closer to, say, rendering a couple of paragraphs of text, but something goes off the rails somewhere, I suppose.

Anyway, I tried Zink OpenGL, which is an OpenGL implementation running on top of Vulkan. That does resolve the performance problem and things run at 60 FPS. For anyone who wants to try that, you need to set the "MESA_LOADER_DRIVER_OVERRIDE=zink" environment variable.

Glad you've got a workaround! Thank you for sharing how to do it; IIRC this has come up a while back, too, so it's good to know there's a solution I can point someone to.
Logged