Guides
These docs are for v2.1.0. Click to read the latest docs for v3.3.0.

FramesPerSecondCanvas

Overview

This canvas adds a frames per second text element to the headset. To use the prefab it must be placed into the scene then the headset camera needs attaching to the canvas:

  • Select FramesPerSecondCanvas object from the scene objects
  • Find the Canvas component
  • Set the Render Camera parameter to Camera (eye) which can be found in the [CameraRig] prefab.

There are a number of parameters that can be set on the Prefab. Expanding the FramesPerSecondCanvas object in the hierarchy view shows the child FramesPerSecondText obejct and clicking on that reveals additional paramters which can be set via the FramesPerSecondViewer script (which can be found in SteamVR_Unity_Toolkit/Scripts/Helper/FramesPerSecondViewer)

Inspector Parameters

  • Display FPS: Toggles whether the FPS text is visible.
  • Target FPS: The frames per second deemed acceptable that is used as the benchmark to change the FPS text colour.
  • Font Size: The size of the font the FPS is displayed in.
  • Position: The position of the FPS text within the headset view.
  • Good Color: The colour of the FPS text when the frames per second are within reasonable limits of the Target FPS.
  • Warn Color: The colour of the FPS text when the frames per second are falling short of reasonable limits of the Target FPS.
  • Bad Color: The colour of the FPS text when the frames per second are at an unreasonable level of the Target FPS.

Example

SteamVR_Unity_Toolkit/Examples/018_CameraRig_FramesPerSecondCounter displays the frames per second in the centre of the headset view. Pressing the trigger generates a new sphere and pressing the touchpad generates ten new spheres. Eventually when lots of spheres are present the FPS will drop and demonstrate the prefab.