Announcement

Collapse
No announcement yet.

VR Template FPSDisplay widget - displaying a moving average

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    VR Template FPSDisplay widget - displaying a moving average

    I find that the real-time FPS display value tends to jump around a bit, so I smoothed it out using a moving average. Figured I'd share the blueprints in case anybody else found this useful.

    It works simply by filling an array of DeltaSeconds entries to a user-defined capacity, and then for each new value, deleting the oldest entry and subtracting it from a running total and adding the new value to the array and to the running total. It then derives the moving average by dividing the running total by the number of entries in the array.

    Smooths things out a bit. Rather than seeing your framerate in real-time all the time, you'll see an average of whatever span you specify. A readout of 74 or 75 means your framerate is pretty consistently locked. Lower values will tell you roughly how often or how badly you're dipping below 75. (A moving average of 60 doesn't mean that you fed frames at that rate, but rather that you held 75Hz much of the time, but dropped to 35Hz for a significant number of frames.)

    Click image for larger version

Name:	fpsDisplayMovingAverageBP.jpg
Views:	1
Size:	223.6 KB
ID:	1145285
    Attached Files
    Last edited by KevODoom; 03-05-2015, 02:55 PM.
Working...
X