How To Migrate a Unity Project

The following migration steps are included below:

These migration steps generally assume an upgrade from one version prior unless noted otherwise. If you are migrating to a version of Vuforia Engine that is several releases ahead of your existing version, we recommend reading through the intermediate release notes for additional details. Also please refer to our articles documenting the changes in new releases:

Vuforia Engine Unity Extension 8.5 Migration Guide

1. Upgrading to Vuforia Engine 8.5

1.1 Using Package Manager in Unity 2019.2 and later

When using Unity 2019.2 or later, Vuforia can simply be upgraded in a project using the Package Manager. Open the Package Manager from Window -> Package Manager, browse to the “Vuforia Engine AR” package and Select “Update to 8.5”:

Vuforia Engine AR Package Manager Version 8.3.9

1.2 Using Unity 2018.4 for HoloLens development

An update installer is provided to patch your Unity 2018.4 installation with Vuforia Engine 8.5 for HoloLens development. Other platforms, including Android and iOS, are not supported with Vuforia Engine 8.5 in Unity 2018.4.
You can find the update installer at https://developer.vuforia.com/downloads/sdk

Please follow the Vuforia Update Installers for Unity to patch your Unity 2018.4 installation:

2. Platform Support 

2.2 Automatic inclusion of the ARCore library

It is no longer necessary to include the ARCore Library into the Unity project manually, instead checking the checkbox in the VuforiaConfiguration under the ARCore Requirement dropdown will automatically include it during the Gradle build. To use a custom version of ARCore, uncheck this setting and include the right library in the Unity project.

Device Tracker ARCore Requirement

3. Removed APIs and Features

3.1 VR Support

Slot-in viewer type devices, as well as rotational device tracking, have been removed in Vuforia Engine release 8.5. Vuforia Engine will automatically determine if it is running on a handheld device or on digital eyewear (HoloLens).

In addition: the following runtime APIs have been removed from the Unity Extension:

  • EyewearDevice, EyewearCalibrationProfileManager and EyewearUserCalibrator
  • All classes and interfaces related to Viewer parameters
  • RotationalDeviceTracker
  • MixedRealityController
  • Some fields and methods in the DigitalEyewearARController

 

Migrating a Vuforia Engine Unity project to Unity 2019.2 using Package Manager

Starting with Unity 2019.2, Vuforia Engine is available through Unity’s package manager service. Vuforia no longer needs to be installed with Unity, it can be added per project using the package manager window. The Vuforia Engine package can also be added directly from the player settings.

The first Vuforia Engine version to officially support package manager is 8.3.

The following article describes how to migrate your existing Vuforia project (based on Unity 2018.4 or 2019.1) to Unity 2019.2 with Vuforia as a package.

  1. Make sure your installed Vuforia Engine version is upgraded to the latest 8.3 version.
  2. Make a backup of your project
  3. In your project, delete the “Vuforia” folder from the Assets:
Unity 2019.2 Migration - delete vuforia folder from assets
  1. Close Unity
  2. Open the same project in Unity 2019.2 and confirm the upgrade dialogue
Vuforia Image
  1. Add the Vuforia package to your project by one of the following methods:
    1. Open the Package Manager UI from Window à Package Manager and search for “Vuforia”. Add the Vuforia Engine package by clicking the “Install” button:
Unity 2019.2 Migration - open package manager UI from windows
  1. Alternatively, you can directly add the Vuforia Engine package by selecting “Vuforia Augmented Reality Supported” from the Player Settings:
Unity 2019.2 Migration - add vuforia engine package directly
  1. Your project should now compile and build again

Vuforia Engine Unity Extension 8.3 Migration Guide

1. Platform Support

1.1 UWP ARM and ARM64 Support

Vuforia Engine 8.3 now supports ARM and ARM64 bit for UWP devices in Unity.

1.2 Configuring ARCore requirements for Android

In previous versions of Vuforia Engine, the requirement to use ARCore was hardcoded in the AndroidManifest.xml file. This has now changed, the setting can be configured in the Device Tracker section of the Vuforia Configuration. If the positional device tracker is enabled in the configuration, the ARCore setting is automatically set to “Optional”, but can be changed after that:

Vuforia Image

Please refer to the following page to learn more about what the different values mean:
https://developers.google.com/ar/develop/java/enable-arcore

Please note that it is still required to include the ARCore client library in your project as described here:
https://library.vuforia.com/content/vuforia-library/en/articles/Solution/arcore-with-vuforia.html

2. API and Workflow Changes

2.1 Model Target Recognition

With Vuforia Engine 8.3, all model target types have been consolidated under a common API and workflow, no longer requiring the Model Recognition game objects for trained targets.
A migration workflow helps to migrate your existing projects to Vuforia Engine 8.3 in Unity.
Please refer to the section “Migrate your project” in the “Introduction to Model Targets in Unity” article:
https://library.vuforia.com/content/vuforia-library/en/articles/Solution/introduction-model-targets-unity.html

3. Deprecated and removed APIs and Features

3.1 VR Support

Slot-in viewer type devices, as well as rotational device tracking, are deprecated. These features are removed in Vuforia Engine release 8.5. Vuforia Engine will automatically determine if it is running on a handheld device or on digital eyewear (HoloLens).

In addition: the following runtime APIs have been marked deprecated:

  • EyewearDevice, EyewearCalibrationProfileManager and EyewearUserCalibrator
  • All classes and interfaces related to Viewer parameters
  • RotationalDeviceTracker
  • MixedRealityController
  • Some fields and methods in the DigitalEyewearARController

3.2 Other deprecated APIs

The following methods in the VuforiaRenderer class have been removed in Vuforia 8.5.

  • GetRendererAPI() – use Unity’s SystemInfo.graphicsDeviceType instead.
  • SetVideoBackgroundTexture() and SetVideoBackgroundTexturePtr()
  • createNativeTexture
  • SetVideoBackgroundConfig()
  • GetVideoBackgroundConfig()
  • ClearVideoBackgroundConfig()

Vuforia Unity Extension 8.1 Migration Guide

  1. New Platform Support
    1. Android ARM64 Support
      Vuforia 8.1 now supports ARM64 bit on Android. Simply select IL2CPP as your scripting backend and add ARM64 to the Target Architectures in the Android player settings of your project:

      Configuration dialog
    2. BitCode Support
      The iOS version of Vuforia 8.1 now contains Bitcode. Provided any other dependencies of your project also contain Bitcode, you may build with Bitcode enabled and use this for App Store submission. It is recommended to test Bitcode recompilation by making an Archive build and then exporting an Ad Hoc .ipa, selecting the "Recompile from Bitcode" option.

      Bitcode is automatically enabled by Unity when it creates the Xcode project. To build without Bitcode, edit the project and turn it off.

      Note that due to a limitation in the recompilation process, if you are going to build for Bitcode then you must embed VuforiaDL.framework in your app even if you are not using a feature that requires it. This is the default behaviour.
  2. API and Workflow Changes
    1. Model Target 3D Guide View Extraction
      With Vuforia 8.1, we have changed the mechanism for Model Target extraction in Unity. The extracted 3D models are used for guide views and editor previews of Model Targets. Previously, the 3D mesh was extracted and set up in a Unity scene once “3D guide view” was selected for a model target in that scene.
      This has now changed so that the mesh is extracted at the time a Model Target dataset is imported into a Unity project. At that time, a prefab is created on the project level in the Resources/VuforiaModels folder. This prefab is used by default for both the editor preview of a model target and when 3D guide views are used at runtime. This makes it easier to update all instances of Model Targets when importing a new version of a database into the project.
      The model extraction can be disabled in the Vuforia configuration if the extracted 3D models are not needed for guide views, preview models, augmentations or if you want to reduce the size of your application.
      If model target extraction is disabled, 3D guide views are not available for model targets in your project.
      If your Vuforia 8.0 (or earlier) project used 3D Model Target guide views, please follow these steps to migrate it to Vuforia 8.1:
      • Open the project with new Vuforia SDK 8.1 -> notice that a new folder Resources/VuforiaModels is generated
      • If your project used the extracted models for anything other than 3D guide view functionality (e.g. as augmentation assets), you’ll need to assign the guid of the old prefab to the new prefab:
        • Close the Unity editor
        • Open meta-files of old (Assets/Models/) and new (Resources/VuforiaModels/) prefab and swap the guid values of the two prefabs
        • Open Unity editor again and verify that new prefabs are used in your scene
        • Alternatively, you can manually replace all instances of 3D guide view prefabs with the new prefab by manually adding them to the scene
      • If you no longer need them, delete all previously extracted 3D models from the folder Assets/Models. There is a separate subfolder for each database.
    2. Public changes to Image class
      The Vuforia Image class has been refactored and optimized for better memory usage. This resulted in the following changes for Vuforia 8.1:
      • The enum Image.PIXEL_FORMAT is replaced by PIXEL_FORMAT. If you used that enum in your code, you’ll need to fix any compiler errors by changing to the new enum.
      • The PIXEL_FORMAT.YUV format was replaced with more explicit format YUV formats by introducing PIXEL_FORMAT.NV21 and PIXEL_FORMAT.NV12.
        If you previously used the YUV format you now need to check for the NV21 or NV12 formats.
        Please note that not all formats are supported on every platform. Rule of thumb:
        • NV12: native image format on iOS and UWP tablet devices
        • NV21: native image format on Android
          There are exceptions to this, for example the Google Pixel C device uses other YUV based formats
      • Image.IsValid() has been marked deprecated and can be replaced with the static Image.IsNullOrEmpty(Image) method.
      • Image.Clear() and Image.ClearUnmanagedData() have been removed, they are not required anymore.
  3. Removed APIs and Features
    1. Front Camera Support
      The previously deprecated front camera functionality has been removed with Vuforia 8.1. You can now only access the back camera.

      As part of this change, the reflection flag was removed as well, which was enabling mirrored rendering. If you still need to have mirror rendering due to your current setup, this is best done in a post processing effect in Unity.
    2. Model Recognition Template Mode
      The template mode for trained Model Targets has been removed with Vuforia 8.1. If you used Model Recognition in your Vuforia 8.0 Unity project, please follow these steps:
      • If you did not use template mode, just remove the template object below the Model Recognition game object in your Unity scene
      • If you did use templates in your project, please follow these steps to implement a similar mechanism on application level:
        • Keep the template game object and make sure that no dataset has been assigned to it (editor shows ---EMPTY--- dataset)
        • Create a custom ModelRecoEventHandler by copying the DefaultModelRecoEventHandler script
        • Instantiate the template object in the OnNewSearchResult method
    3. Other removed APIs
      The following methods, interfaces and classes have been deprecated in previous Vuforia versions and have now been removed with Vuforia 8.1:
      • PositionalDeviceTracker.CreateMidAirAnchor(string name, Transform transform):
        Use CreateMidAirAnchor(string name, Vector3 position, Quaternion rotation) instead.
      • DeviceTrackerARController.FusionProvider: Use VuforiaRuntimeUtilities.SetAllowedFusionProviders instead.
      • ICloudRecoEventHandler: Use IObjectRecoEventHandler instead.
      • ObjectTracker.TargetFinder: Use GetTargetFinder instead.
      • AnchorStageBehaviour: use AnchorBehaviour instead.
      • FusionProviderType. OPTIMIZE_IMAGE_TARGETS_AND_VUMARKS and OPTIMIZE_MODEL_TARGETS_AND_SMART_TERRAIN: Use ALL instead.
      • VuforiaRuntime.HasInitialized: use VuforiaRuntime.InitializationState or VuforiaManager.Initialized instead.
    4. Newly deprecated APIs
      The following field has been deprecated in Vuforia 8.1 and will be removed in a future Vuforia version:
      • TargetFinder.CloudRecoSearchResult.TargetSize

Migrating Unity Projects to Vuforia Engine 7.2

Extended Tracking

In Vuforia Engine 7.2, the Extended Tracking API has been deprecated. The functional equivalent continues in the form of the Device Tracker.  Developers can enable Extended Tracking functionality by enabling the Positional Device tracker.

Developers migrating applications which use Image Targets, VuMarks, Multi-Targets, Cylinder Targets or Object Targets and are looking for equivalent Extended Tracking functionality as pre 7.2 should follow these steps:

  1. Open the Vuforia Configuration panel (Windows> Vuforia Configuration or Ctrl+Shift+V)
  2. Check the "Track Device Pose" option under the "Device Tracker" section
  3. Confirm that the Tracking Mode is set to "POSITIONAL"
  4. Select "Optimize for Image Targets and VuMarks" for "Fusion Mode"
Vuforia Image

The following APIs have been deprecated:

  • Target.StartExtendedTracking()
  • Target.StopExtendedTracking()

Instead of calling these APIs for each target, call TrackerManager.Instance.InitTracker<PositionalDeviceTracker>() once to enable Extended Tracking functionality on all targets. Be sure to start the Device Tracker.

For more information on Extended Tracking, please refer to the Extended Tracking documentation.

Device Tracker

The Device Tracker no longer requires a specific World Center Mode. Device Tracker can work alongside all World Center Modes.

Targets will continue to report pose information when the target is out of view and Device Tracking is enabled. If Device Tracking is not enabled and the target goes out of view, tracking will be lost (NO_POSE).

Device Tracking can be enabled in the Vuforia Configuration Panel as seen in the previous screenshot.

Device Tracking can also be enabled via code:

  void Awake(){
     VuforiaARController.Instance.RegisterVuforiaInitializedCallback  (OnVuforiaInitialized); 
 } void OnVuforiaInitialized() {
     deviceTracker = TrackerManager.Instance.InitTracker<PositionalDeviceTracker>(); 
 }

The device tracker can now be started/stopped anytime at runtime without the need to re-initialize the camera with:

deviceTracker.Start();

and

deviceTracker.Stop();

For more information on the Device Tracker, please refer to Using the Device Tracker document

Vuforia Fusion

Also part of Vuforia Engine 7.2, we are updating the Device Tracker to leverage Vuforia Fusion. Vuforia Fusion refers to the internal techniques used by the Vuforia Engine to take advantage of the best platform enablers (such as ARCore and ARKit) while still providing developers with the broadest reach of devices.

Vuforia Fusion works by choosing the best technology for Device Tracking. Please refer to the following list for default priority:

Vuforia Fusion Default Priority:

  1. Platform Enablers (ARKit/ARCore)
  2. Vuforia VIO
  3. Vuforia SLAM

Due to addition of support for platform enablers, it is important that AR content, targets, and physical objects all have their coordinate scale in meters. Objects that do not have their scale set appropriately may not track well.

 

For more information about Vuforia Fusion, please refer to the Vuforia Fusion documentation.

World Center Mode

  • DEVICE - The camera now moves if the device tracker is enabled. If the device tracker is not enabled, the camera will stay fixed at the last position. Targets always moves in this mode.
  • FIRST_TARGET / SPECIFIC_TARGET - The first Target or the specified target will be at the last position and not move
If your experience uses physics or otherwise requires a GameObject to remain static for performance reasons, consider using SPECIFIC_TARGET.

ARCore

To enable ARCore support in Unity, please refer to Using ARCore with Vuforia document.

Front Facing Camera

Front-facing camera support has been deprecated in Vuforia Engine 7.2.

Vuforia Engine Initialization

Vuforia Engine 7.2 has made some changes to the initialization process that may impact the flow of your application. The default initialization behavior of Vuforia Engine 7.2 is to download the latest device profile in order to deliver the best experience on the device.  Depending on the speed of the user's internet, this could add several seconds to application load. This only occurs the very first time the user launches the app and will not impact application loading in future launches of the app.

It is strongly recommended to allow the Vuforia Engine to fetch the latest device profile. Developers looking to disable this behavior should set the following hint before initializing Vuforia Engine: VuforiaUnity.SetHint(VuforiaHint.HINT_ASYNC_FETCH_OF_LATEST_CALIBRATION, 1);


Earlier Versions