Migration Guide
Migrating an ARDK 2.X Project to 3.0
To upgrade an existing project:
- Follow the instructions at Installing ARDK 3.0, stopping after step 3.
- Clean up redundancies in your code, such as deleting protobuf and telemetry plugins in ARDK 2.X.
- Complete the ARDK 3.0 installation steps, starting from step 4.
- Replace 2.X managers (such as
ARSession
) with 3.0 managers. See the Manager Conversion Guide for a list of 2.X managers and their 3.0 counterparts. - Replace references to
Niantic.ARDK
in scripts with the relevantNiantic.Lightship
references. - Once you have converted everything and your project compiles, delete the old ARDK folder.
Manager Conversion Guide
ARDK 2.X Component | ARDK 3.0 Component |
---|---|
ARSessionManager | ARSession + ARCameraManager |
ARRenderingManager | ARCameraManager + ARCameraBackground |
ARCameraPositionHelper | TrackedPoseDriver |
ARDepthManager | AROcclusionManager (+ LightshipOcclusionExtension ) |
ARDepthInteroplationAdapter | LightshipOcclusionExtension |
ARMeshManager | ARMeshManager (+ LighsthipMeshingExtension ) |
ARPlaneManager (from ARDK 2.x) | ARPlaneManager (from AR Foundation) |
ARSemanticSegmentationManager | ARSemanticSegmentationManager (+ LightshipOcclusionExtension ) |
GameboardManager | LightshipNavMeshManager |
Feature Conversion Guide
1. Session Management
In ARDK 2.X, AR session management was handled by an ARDK MonoBehaviour component called ARSessionManager
.
In ARDK 3.0, AR session management is handled by AR Foundation in a MonoBehaviour component called ARSession
. For more information on how to set up a basic AR scene using the ARSession
component, see How to Setup an AR Scene. For more information, see Unity’s documentation.
2. Rendering
In ARDK 2.X, rendering was handled by an ARDK MonoBehaviour component called ARRenderingManager
.
In ARDK 3.0, rendering is handled by AR Foundation. The device camera is handled by a MonoBehaviour component called ARCameraManager
. The composition of the camera frame and CG content is handled by a MonoBehaviour component called ARCameraBackground
. For more information, see Unity Camera Components (opens in new window).
ARDK 2.X | ARDK 3.0 |
---|---|
[ARSessionManager] IsLightEstimationEnabled | [ARCameraManager] LightEstimation |
[ARSessionManager] IsAutoFocusEnabled | [ARCameraManager] AutoFocus |
[ARRenderingManager] RenderTarget | Always set to Camera |
[ARRenderingManager] Camera | Always the camera with the ARCameraManager |
3. Depth / Occlusion
In AR, depth textures are used to dynamically occlude digital content.
In ARDK 2.X, depth textures were exposed through the ARDepthManager
. Depth interpolation was done in the ARDepthInterpolationAdapter
and semantic suppression of depth-based occlusion was set up in the ARSemanticSegmentationManager
.
In ARDK 3.0, depth-based occlusion is handled by the AROcclusionManager
provided by AR Foundation. Additional ARDK occlusion settings are now all enabled through the LightshipOcclusionExtension
, such as interpolation modes, occlusion suppression, and occlusion stabilization.
ARDK 2.X | ARDK 3.0 |
---|---|
[ARDepthManager] KeyFrameFrequency | [LightshipOcclusionExtension] TargetFrameRate |
[ARDepthManager] OcclusionMode | Always using DepthBuffer in ARCameraBackground |
[ARDepthManager] StabilizeOcclusionExperimental | [LightshipOcclusionExtension] OcclusionStabilization |
[ARDepthManager] PreferSmootherEdges | Not supported yet |
[ARDepthManager] Interpolation | Depth buffer always returned interpolated |
[ARDepthInterpolationAdapter] Mode - SampleFullScreen - TrackOccludee | [LightshipOcclusionExtension] Mode - Static - SpecifiedGameObject |
[ARDepthManager] Occludee | [LightshipOcclusionExtension] PrincipalOccludee |
4. Meshing
In ARDK 3.0, Meshing is exposed through a MonoBehaviour component called ARMeshManager
, now provided by AR Foundation. In addition, ARDK-specific settings can be changed through the LightshipMeshingExtension
component. The settings from ARDK 2.x are still included, but some are renamed:
ARDK 2.X | ARDK 3.0 |
---|---|
[ARMeshManager] FrameRate | [LightshipMeshingExtension] TargetFrameRate |
[ARMeshManager] FrameRateTargetBlockSize | [LightshipMeshingExtension] MeshBlockSize |
[ARMeshManager] MeshingRangeMax | [LightshipMeshingExtension] MaximumIntegrationDistance |
[ARMeshManager] VoxelSize | [ARMeshManager] VoxelSize |
[ARMeshManager] MeshPrefab | [ARMeshManager] MeshPrefab |
[ARMeshManager] MeshRoot | Fixed to XROrigin -> CameraOffset -> Trackables |
[ARMeshManager] FrameRateColliderUpdateThrottle | [ARMeshManager] Handled by ConcurrentQueueSize |
[ARMeshManager] MeshVisibilitySettings | Set via prefab material directly |
5. Planes
In ARDK 3.x, plane finding and visualization use AR Foundation's implementation of ARPlaneManager
, a wrapper over ARKit and ARCore. This is similar to what was done in ARDK 2.x, but with differences at runtime. Please take a look at the AR Foundation Samples to better understand how to use ARPlaneManager
from AR Foundation in your application.
ARDK 2.X | ARDK 3.0 |
---|---|
IARPlaneAnchor | ARPlane |
ARSession.AnchorsAdded | ArPlaneManager.planesChanged |
ARSession.AnchorsUpdated | ArPlaneManager.planesChanged |
ARSession.AnchorsMerged | ArPlaneManager.planesChanged |
ARSession.AnchorsRemoved | ArPlaneManager.planesChanged |
6. Semantics
In ARDK 3.0, semantics are still handled by ARSemanticSegmentationManager
. The new manager offers functions that get packed semantics and confidence values per channel without having to prepare confidence channels. Interpolation can be done with a SamplerMatrix
that is returned on every semantic frame. Semantic depth suppression settings have been moved to LightshipOcclusionExtension
.
ARDK 2.X | ARDK 3.0 |
---|---|
KeyFrameFrequency | TargetFrameRate |
DepthSuppressionChannels | [LightshipOcclusionExtension] SuppressionChannels |
PersistentConfidences | Now directly accessed through the manager |
Interpolation | Done with SamplerMatrix (see samples) |
7. Gameboard / LightshipNavMesh
The Gameboard feature from ARDK 2.X has been renamed to LightshipNavMesh in ARDK 3.0.
The implementation is the same, but visualization is now handled by an additional component called LightshipNavMeshRenderer
.
8. VPS Coverage
VpsCoverageExampleManager
has been reworked into the CoverageClientManager
Component. Private AR locations can now be added through an ARLocationManifest
instead of a VpsCoverageResponse
object.
ARDK 2.X | ARDK 3.0 |
---|---|
[VpsCoverageExampleManager] CoverageClientRuntime | Always calls live service |
[VpsCoverageExampleManager] MockResponses (ScriptableObject) | [CoverageClientManager] PrivateARLocations (ARLocationManifest) |
[VpsCoverageExampleManager] SpoofLocation - Lat_degrees - Lon_degrees | [CoverageClientManager] SpoofLocationUseCurrentLocation - QueryLatitude - QueryLongitude |
[CoverageClientManager] VoxelSizeTargetImage | The [CoverageClientManager] is not tied to a sample anymore |