- 最后登录
- 2024-6-3
- 注册时间
- 2009-10-16
- 阅读权限
- 100
- 积分
- 18803
- 纳金币
- 17488
- 精华
- 1
|
Frame Rate Watcher (Miscellaneous Behavior)
Summary
Fires events as the frame rate of the presentation enters one of three ranges.
Category
Latest Behaviors
Author
Gavin Kistner
Difficulty
(Reference)
Time to Complete
5 Minutes
Downloads
Click Here
to download the associated files.
(This document covers version 1.0.4 of the 'Frame Rate Watcher' behavior, current as of 2005-Feb-11)
Description
This behavior calculates the frame rate of the presentation, and fires one of three events as the frame rate enters certain ranges:
Terrible Fps
—This event fires when the frame rate drops below the value of the
Low FPS
property.
Acceptable FPS
—This event fires when the frame rate is between the
Low FPS
and
High FPS
values.
Awesome FPS
—This event fires when the frame rate exceeds the
High FPS
value.
These events may be used to cause a presentation to automatically adjust itself to the user’s machine speed, switching to lower-resolution models and image maps if the frame rate is too low, or perhaps hiding certain items.
The frame rate to use for the tests can be calculated in one of three ways, specified by the
FPS Method
advanced property:
Running Average
—(default)The frame rate is calculated as a running average over a certain number of frames, specified by the
Running Avg Size
property.
Quick Average
—The frame rate is calculated as halfway between the previous average and the last frame’s rate. Responds quickly to sharp changes in frame rate, but takes a long time to reflect any stable
FPS
‘plateau’.
Overall Average
—The average frame rate for the entire duration of the presentation.
Last Frame Only
—The frame rate reflected by how long the last frame took to compute. (This rate is ‘fickle’ and may have dramatic spikes.)
The
Crossover Threshold
advanced property is used to prevent slight fluctuations in frame rate across the border between two ranges from firing the two events. With an acceptable
Low FPS
value of 10 and a
Crossover Threshold
value of 2, the frame rate will enter the “
Terrible FPS
” range if the frame rate drops below 10fps, but will not return to the “
Acceptable FPS
” range until the frame rate rises above 12fps. The same is true for border between “
Acceptable FPS
” and “
Awesome FPS
”.
Finally, in addition to firing events based on the specified frame rate calculation, placing this behavior anywhere in the scene will create and maintain four new properties on the
player
object:
player.runningFPS
—The
Running Average
frame rate.
player.quickFPS
—The
Quick Average
frame rate. (aka
player.avgFrameRate
)
player.overallFPS
—The
Overall Average
frame rate.
player.lastFPS
—The
Last Frame Only
frame rate. (aka
player.frameRate
)
This behavior will function the same whether you attach it to the Scene or to any other object; the only reason to attach it to other objects would be for convenient relative referencing by an object which uses this behavior.
Basic Properties
Low FPS
Minimum Frame Rate for the 'Acceptable FPS' range.
High FPS
Minimum Frame Rate for the 'Awesome FPS' range.
Advanced Properties
FPS Method
Which FPS calculation should be used to fire the events?
Running Avg Size
How many frames should be averaged for the Running Average FPS?
Crossover Threshold
Size (in FPS) of the boundary between ranges.
Events
Terrible FPS
Fires if the frame rate drops below the 'Low FPS' value.
Acceptable FPS
Fires once when the frame rate moves between the Low and High values.
Awesome FPS
Fires if the frame rate is above the 'High FPS' value.
Demonstration
View Demonstration Project
Download Project File
|
|