Exploring Eye Tracking on VIVE Pro Eye Using the SRanipal SDK

This article is a translated version of my original post on Qiita. Original (Japanese): https://qiita.com/segur/items/3a18b5f41d19f8e1af1d

2019-08-13 00-02-26.mjpg.gif

2019-08-13 01-53-11.mjpg.gif

Originally, I was planning to write a different article, but having gotten my hands on a VIVE Pro Eye, I decided to try out the SRanipal SDK, which I had been interested in for its eye tracking capabilities.

What is VIVE Pro Eye?

The VIVE Pro Eye is a VR headset capable of eye tracking, an advancement over its predecessor, the VIVE Pro.

What is SRanipal SDK?

The SRanipal SDK is designed to track users' eye and lip movements. However, the VIVE Pro Eye alone does not support lip movement tracking.

According to a video from HTC VIVE's official YouTube channel about GDC 2019, SRanipal is apparently pronounced as Esu-Aru Aniparu.

System Requirements

I verified the following setup:

Downloading the SRanipal SDK Eye

You can download it from the following link: Intro To SRanipal SDK

Follow the instructions to reach a page where you can download SRanipal_SDK_1.0.1.0_Eye.zip. (Do not mistakenly download the Lip variant, as I did!)

image.png

Introducing the SDK to Your Project

Create a new project in Unity and import 02_Unity\Vive-SRanipal-Unity-Plugin.unitypackage from the downloaded zip file.

image.png

Activate Virtual Reality Supported via EditProject SettingsPlayerXR Settings.

image.png

Calibrating for Eye Tracking

Open Assets\ViveSR\Scenes\EyeSample and play the scene.

When wearing the headset, if calibration is needed, a dialog will prompt you to proceed. Follow the instructions to calibrate.

image.png

image.png

image.png

A blue dot lights up indicating the calibrated gaze direction! You can redo the calibration later under the VIVE PRO section.

Upon closing the dialog, you'll see this view:

image.png

Trying the Sample Scene

Reopen Assets\ViveSR\Scenes\EyeSample and play the scene.

You'll be greeted by an avatar in a mirror that's tracking your eye movements.

Creating Your Own Scene

Let's recreate the sample scene with an avatar of a female instead of the male one. Start by opening Assets\Scenes\SampleScene in Unity 2018 (or create a new one).

Adding Game Objects to Your Scene

Add the following to your scene:

Your Hierarchy should look like this:

image.png

Editing the MirrorCamera

Add SRanipal_MirrorCameraSample_Eye to MirrorCamera.

Add a Camera component and set Target Texture to Assets\ViveSR\Materials\MirrorRenderTexture.

Adjust Transform settings to rotate 180° on the y-axis.

image.png

Editing the MirrorRenderer

Set Mesh Renderer’s Materials to Assets\ViveSR\Materials\MirrorMaterial.

Adjust Transform to flip the X scale to -1.

image.png

Now the mirror is done!

Editing the Main Camera

Set the Transform as follows:

image.png

Editing the Avatar_Fairy

Add a SRanipal_AvatarEyeSample component to Avatar_Fairy.

Set Eyes Models size to 2 with the following elements:

Set Eye Shape Tables size to 1 with:

image.png

Click the right box in Eyebrow Animation Curve Upper, draw a curve in the Curve dialog. A straight line should suffice initially.

image.png

Repeat these steps for Eyebrow Animation Curve Lower and Eyebrow Animation Curve Horizontal.

And there you have it!

Playing the Scene

When you play the scene, it should look like this!

2019-08-13 01-53-11.mjpg.gif

The eye movements might seem a bit eerie... Adjusting the Eyebrow Animation Curve might help improve the appearance.

Conclusion

I successfully implemented eye tracking in Unity.

In creating this article, I referred to the following resources: