playMaker

Author Topic: Target Frame Rate (WaitForTarget FPS) causing significant CPU overhead  (Read 2404 times)

...

  • Beta Group
  • Hero Member
  • *
  • Posts: 1294
Hi guys,

i'm using target frame rate action to clamp the frame rate, but there seems to be a lot of overhead every frame. Now i'm not sure how it actually works, does it use the calculated amount of cpu time to actually keep the frame rate in the defined upper limit, or something's just plain wrong. I'm not using Vsync btw, i'm not sure if it's really neccessary, but the action works without it and doesn't push frame rave over defined threshold.

With Target Frame Rate



Without Target Frame Rate



jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15620
  • Official Playmaker Support
Re: Target Frame Rate (WaitForTarget FPS) causing significant CPU overhead
« Reply #1 on: December 23, 2019, 08:02:14 AM »
Hi,

 I think it's the internal mechanism of capping the fps that you see here.

 I would ask on Unity Forum or UA for this.

why do you want to restrict fps? I hope you are not making frame dependant animations :)

Bye,

 Jean

...

  • Beta Group
  • Hero Member
  • *
  • Posts: 1294
Re: Target Frame Rate (WaitForTarget FPS) causing significant CPU overhead
« Reply #2 on: December 23, 2019, 08:14:34 AM »
I'm having issues with some timers that use wait and countdown timer, when FPS is not capped they seem to finish a lot earlier.

But yeah, i believe that it's unity capping the cpu to keep the framerate in check, but the thing is, when used via script with vsync disabled it does not create overhead. When used via action with vsync disabled then it does.
« Last Edit: December 23, 2019, 08:17:56 AM by krmko »

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15620
  • Official Playmaker Support
Re: Target Frame Rate (WaitForTarget FPS) causing significant CPU overhead
« Reply #3 on: December 23, 2019, 12:26:01 PM »
Hi,

 timer should use for example, floatAdd and check per seconds, it will then be completly fps independent.

I would say that for the sake of learning and accuracy, you should try to find out why  your timers are not behaving and get to the bottom of it, then you can take a decision.

Bye,

 Jean