Tobii XR Devzone > Develop > Tobii Ocumen > Ocumen I/O > Unity/C# >

Ocumen I/O - Recorders

Once you enable recordings in your app you can use Tobii Ocumen Studio to inspect what happened.

Table of Contents


Recorders are scripts that can be added to your Unity project to record data to a .ocumen file. Recorder scripts should be attached to the same GameObject as the Tobii Recording Manager script, which orchestrates the recording process.

Recorders will search for relevant objects in the scene and record them, such as gaze data or colliders.

Unless otherwise stated, the following properties are true for all recorders:

  • Recorders are invoked once per Unity frame.
  • The timestamp used will be updated in a coroutine right after Update has run on all game objects.
  • Timestamps are sampled from the system clock.

If you want to record a custom data type which is not supported by the included recorders, you can create your own recorder using one of the recorder scripts as a template.

Advanced Eye Tracking Recorder

Records native Tobii Eye Tracking data.

  • This recorder records the output of TobiiXR.Advanced.QueuedData
  • The eye tracking clock is by default synchronized to the system clock.
  • If multiple eye tracking samples have arrived since the last frame, all samples will be written with their original time stamp. In other words, eye tracking data keep its system synchronized timestamp in the recording so you won’t have to worry about if the eye tracker runs at a higher or lower frame rate than your application.
  • Requires Headset Pose Recorder to be able to calculate the gaze direction in world space, in order to for example visualize the gaze rays.

Headset Pose Recorder

Records the camera pose and the view and projection matrices of the left and right virtual camera.

  • Many headsets do not deliver valid matrices when they are not rendering so this recorder only records data when the application is rendering.

Rendered Video (Alpha)

Records a video capture of the left eye’s camera view in the HMD.

  • Supports OpenGL ES 3.0 and higher on Android platforms.
  • Currently only supports NVIDIA graphics cards using DirectX 11 on Windows platforms.
  • The Video Recorder is currently in Alpha state. It does not support all platforms and may exhibit a temporal offset when played back. When replaying video in Ocumen Studio, there is a slider for manually adjusting the offset to match the video with the rest of the recording.
  • Video data averages about 1 MB per second and usually dominates recording size by up to 2 orders of magnitude. While enabling video can give you authentic insights in highly dynamic (e.g., shader driven) scenes, disabling video can yield minute-long recordings that are just a few kilobytes long.

Controller Recorder

Records pose and input from VR controllers

  • Does not record axis values such as joystick or touchpad.
  • The controller input is recorded using Unity’s XR Input.

Mesh Recorder

Records vertices and world position for all visible meshes in the scene belonging to a MeshRenderer or a SkinnedMeshRenderer.

  • For models you want to record, make sure Read/Write Enabled is checked in the inspector window. Read more at Unity’s documentation.
  • If you want to record meshes for static objects you may have to turn off Static Batching in Player Settings since Static Batching creates a combined mesh that is not always readable from CPU.

Collider Recorder

Records any colliders attached to game objects in your scene.

  • Sphere and box colliders are recorded as is.
  • Mesh and capsule colliders are recorded as boxes.
  • Collider type is currently only recorded the first time the collider is encountered.
  • Only records one collider per object.
  • Duplicated objects that contain children colliders in a Unity scene will only allow for one recorded collider in the duplicated object.

Frame Data Recorder

Records the frame number given by UnityEngine.Time.frameCount.