Eye tracking with Native SDK

Note: you are currently viewing documentation for a beta or an older version of Varjo


You can acccess the following eye tracking data through the Varjo API:

  • leftEye [varjo_ray]
  • rightEye [varjo_ray]
  • gaze [varjo_ray]
  • focusDistance
  • stability
  • captureTime
  • leftStatus
  • rightStatus
  • status
  • frameNumber
  • leftPupilSize
  • rightPupilSize


varjo_ray returns data about eye position coordinates [origin (x, y, z)] and vector direction [forward (x, y, z)]. Data is recorded for the left eye (leftEye), right eye (rightEye), and their combined value (gaze). Gaze data is given in the left-hand coordinate system and relative to head pose.

focusDistance returns the distance between eye and focus point. It has a value between 0 and 2 meters.

stability returns the stability of the user’s focus. It has a value between 0.0 and 1.0, where 0.0 indicates least stable focus and 1.0 most stable.

captureTime returns a timestamp, in nanoseconds, of when the data was recorded.

leftStatus and rightStatus return a value for each eye as follows:

  • 0 – eye is not tracked and not visible (e.g., the eye is shut)
  • 1 – eye is visible but not reliably tracked (e.g., during a saccade or blink)
  • 2 – eye is tracked but quality is compromised (e.g., the headset has moved after calibration)
  • 3 – eye is tracked

status returns a value for the status of eye tracking in the Varjo headset as follows:

  • 0 – data unavailable; user is not wearing the device or eyes cannot be found
  • 1 – user is wearing the device, but gaze tracking is being calibrated
  • 2 – data is valid

frameNumber returns a unique identifier of the frame when the data was recorded.

leftPupilSize and rightPupilSize return values for the size of the pupil, calculated according to the pupil size range detected by the Varjo headset. Values are between 0 and 1.

Fast calibration

Two optional parameters can be passed for tracking. If no parameters are passed, default calibration is triggered.

The first parameter, GazeCalibrationType can be given as Legacy or Fast.

Legacy calibration is currently the default mode of calibration, and takes longer. Fast calibration is a new 5-point calibration, which requires much less time to complete. However, it is currently in Beta state and its validation is ongoing. Proven results therefore rely on Legacy calibration.

The second parameter passed is OutputFilterType. It defines whether you want to receive smoothed tracking data, which looks better and has less flickering, or the raw data. For processed data, pass the key Standard. For raw data, pass None.

In order to request specific data, call RequestGazeCalibrationWithParameters and pass GazeCalibrationParameters as a parameter.