Working with Digital Eyewear in Unity

The digital eyewear samples demonstrate how to develop and configure Vuforia Engine apps for both optical and video see-through Digital Eyewear.

There are two Digital Eyewear samples:

  • Stereo Rendering, for optical see-through devices
The stereo rendering sample will show you how to configure a stereo display for your Vuforia Engine apps. This sample is applicable to supported optical see-through devices supported by Vuforia Engine.
  • AR/VR, for video see-through devices

The AR/VR sample will show you how to develop AR/VR mixed reality experiences for video see-through devices that can seamlessly transition between AR and VR modes within the same app.

Integrating Cardboard to the AR/VR Sample

Importing the samples

To import the Digital Eyewear samples into a new Unity project:

  1. Activate Vuforia AR Support and VR Support in XR Settings for your project.
  2. Add Vuforia as the 1st VR SDK for your project - this option is presented once you activate VR Support in XR Settings.
  3. Select Import for the sample in the Unity Asset Store.
  4. Accept all of the sample assets from the Import dialog.

To import the samples into Unity:

  1. Search for "Vuforia Stereo Rendering for Digital Eyewear" in the Unity Asset Store.
  2. Download and import the sample into Unity.
  3. Because this is a complete project, Unity will prompt you to create an empty project if you already have content.

Running the samples

Before you build and run on the Android device

  1.  Ensure the latest Android SDK has been installed and that its location has been defined in the Unity Editor ( Unity > External Tools > Android SDK Location ).
  2.  For ODG and HoloLens, ensure that you have configured the drivers for your eyewear device on your computer following the instructions provided by the manufacturer. But this step isn't necessary for phone-based stereo viewers such as Merge.
  3. Connect the device to your PC/Mac and check that the command adb devices results in a log that shows that it is connected.

Building and Executing the Sample

  1. Set your platform build target in File > Build Settings. For Android, set the Device Filter to ARMv7 in Other Settings
  2. Add your scene(s) to Scenes in Build.
  3. Define a unique Bundle ID in Player Settings > Other Settings.
  4. Define a unique Product Name to serve as the name of the app when installed on a device.
  5. Select Build to generate an executable or Build & Run to both generate an executable and deploy it to a connected device.
  6. You may be asked to specify the location of the installed Android SDK configured your Unity installation for Android already.

    There is no need to change any of the default Player Settings to support Vuforia Engine for Digital Eyewear. You can customize the presentation of your app on the device by adding icons and splash images in Player Settings and setting the app s device orientation.

    When running the sample on a device you should see a stereo rendering of the AR content with a different image delivered to each eye. The video background will be turned off. The devices will be switched to 3D mode by Vuforia Engine prior to showing any augmentation.



Using the Unity Stereo Rendering for Digital Eyewear Sample

The stereo rendering sample for Unity demonstrates how to configure a Vuforia Unity scene for stereo displays, to support both optical and video see-through digital eyewear apps.

This article highlights the Game Objects and script components that are significant to enabling stereo rendering and describes the configuration options that can be used to customize stereo rendering in a scene.

Sample Elements

Project Structure

Vuforia Image

Folder Name



Target textures as both jpegs and PDFs for printing

Resources used in the sample
/Resources Resources loaded during runtime
/Scenes The sample scenes
/Scripts Scripts that are specific to the sample
Device databases used in the sample
/Vuforia The Vuforia Unity extension libraries


Open the scene named "2-StereoAR" in the "/Scenes" folder.

Scene Hierarchy

Vuforia Image



ARCamera Manages the scene and device cameras along with the main Vuforia application process
ImageTarget_Astronaut An Image Target instance for the Astronaut Image
ImageTarget_Drone An Image Target instance for the Drone Image  
ImageTarget_Oxygen An Image Target instance of the Oxygen Tank Image
ImageTarget_Fissure An Image Target instance of the Fissure Image
InitErrorHandler Handles errors and displays them in the UI

Scene View

Vuforia Image

The sample scene depicts four Image Targets configured using the default Data Base. Each Image Target has a corresponding 3D Model or Particle system.


Vuforia Image

Fields and Options



App License Key Add a license key when you're ready to customize the sample with your own targets.
Camera Device Mode A hint to indicating whether framerate or render quality should have priority when the app is running
Delayed Initialization
Use programmatic Initialization instad of automatic initialization
Max Smultaneous Tracked Images
The number of images to detect simultanously
Max Smultaneous Tracked Objects
The number of objects to detect simultanously
Camera Direction
Specify which of the cameras on the device to use
Mirror Video Background
Flip the orientation of the background video (only for video see-through devices)

Digital Eyewear

Vuforia Image



Eyewear Type Defines the target See-Through device type, default is None

Digital Eyewear Video See-Through Selection

Vuforia Image



Stereo Camera Config Indicates which stereo camera rig to use, support is provided for  Oculus. The default is the native Vuforia camera rig.
Viewer Type Defines which AR/VR Viewer to use from a selection of supported viewers, including Merge VR, and also a custom, developer defined, viewer type.
Camera Offset Defines the distance between the stereo viewports. This setting can be used to set IPD and also to adjust eye convergence for scenes with subject matter that is very close.

Configuring the ARCamera Prefab for Digital Eyewear

Follow these instructions to configure the Digital Eyewear section of the VuforiaConfiguration asset to support either Optical or Video See-Through head-worn eyewear devices. These settings will configure your project for stereo rendering and also enable you to specify whether Vuforia Engine should utilize the functionality for a 3rd party AR/VR SDK.

1. Add an ARCamera instance to your scene.
2. Select which eyewear type you are building for in the Digital Eyewear section

Selecting either Optical or Video See-Through will add a pair of stereo cameras to your ARCamera hierarchy.

After setting the Eyewear Type to Video See-Through, you can specify which Stereo Camera Configuration to use. This setting enables you to bind the Vuforia ARCamera to the camera rig of a 3rd party SDK, such as Oculus. If you aren't utilizing a 3rd party SDK with Vuforia, you can simply use the default Vuforia Stereo Camera Config.

Configuring for Optical See-Through Eyewear

Steps to configure for  Optical See-Through Eyewear

Select the See Through Configuration for the eyewear device you are using. If you don't see a configuration specific to your device make and model, select the Vuforia configuration.

Configuring for Video See-Through Eyewear

Steps to configure for Video See-Through Eyewear

Now define which Viewer Type you are targeting - again, this only applies to Video See-Through eyewear.

4. Set a camera offset for Play Mode and video see-through eyewear

The camera offset should correspond to the interpupillary distance that you want to simulate in Play Mode and for apps running on devices. The interpupillary distance (IPD) is the distance between the centers of the pupils of someone's eyes. Typical IPD values for adults is between 54 and 68mm.

Note: Camera offset has no effect in apps running on optical see-through devices.


Viewport Configuration for Video See-Through Eyewear

The size and offset distance of the stereo viewports for camera see-through devices can be configured using the Camera Offset field in the VuforiaConfiguration asset which is accessible from the ARCamera's Inspector panel via the Open Vuforia Configuration button. You can also search for VuforiaConfiguration in the Project panel.

Camera Offset defines the distance between the stereo viewports in scene units (mm) and can be used to define an interpupillary distance ( IPD ) for the user. Camera Offset is only applicable to video see-through applications, and has no effect on optical see-through devices. The Camera Offset can be adjusted at runtime in Play Mode to evaluate the effect of different settings. The following example uses a camera offset of 42mm and a scale factor of 0.32.


Alt something