EasyAR support for Unity XR framework
EasyAR does not rely on the Unity XR framework to provide AR capabilities, but it can support some components within the Unity XR framework, enabling the use of features provided by Unity XR when utilizing EasyAR's AR functionalities in Unity. The following content details EasyAR's support for the Unity XR framework and situations where AR Foundation might be considered.
Unity XR support
Unity supports XR development through its plugin framework and series of packages and toolkits. EasyAR also supports these Unity XR packages, allowing users to leverage Unity XR framework features while utilizing EasyAR's AR functionalities in Unity.
EasyAR supports the following Unity XR packages:
| Display name | Package name | Minimum supported version | Required | Purpose |
|---|---|---|---|---|
| XR Core Utilities | com.unity.xr.core-utils | 2.0.0 | No | Provides Unity.XR.CoreUtils.XROrigin support |
| AR Foundation | com.unity.xr.arfoundation | 5.0.0 | No | Provides AR Foundation support |
| XR Plugin Management | com.unity.xr.management | 3.0.0 | No | Provides ARCore SDK management compatibility and runtime XR Loader type retrieval |
| XR Interaction Toolkit | com.unity.xr.interaction.toolkit | 2.0.0 | No | Not directly used |
| PolySpatial visionOS | com.unity.polyspatial.visionos | 2.0.41 | No | Not directly used |
| Apple visionOS XR Plugin | com.unity.xr.visionos | 2.0.41 | No | Not directly used |
| Apple ARKit XR Plugin | com.unity.xr.arkit | 5.0.0 | No | Not directly used |
| Google ARCore XR Plugin | com.unity.xr.arcore | 5.0.0 | No | Provides ARCore SDK management compatibility |
Note
EasyAR does not rely on the Unity XR framework to provide AR capabilities. Therefore, if there are no usage requirements for Unity XR components like AR Foundation, these packages do not need to be installed. EasyAR will still function properly on supported devices.
AR Foundation support
AR Foundation is Unity's AR development framework, with its AR capabilities implemented through underlying systems or third parties, commonly used to support ARCore, ARKit, and some headsets.
Relationship between EasyAR and AR Foundation
block
columns 6
block:groupApp:6
block:groupAppWrapper
space
App1["EasyAR<br>App"]
space
App2["EasyAR + AR Foundation<br>App"]
space
App3["AR Foundation<br>App"]
end
end
block:groupSensePlugin:4
columns 1
SensePlugin["EasyAR Sense Unity Plugin"]
space
end
block:groupARF
columns 1
ARF["AR Foundation"]
space
end
block:groupXRI
columns 1
XRI["XR Interaction Toolkit"]
space
end
block:groupAREngineInterop
columns 1
AREngineInterop["EasyAR<br>AR Engine Interop"]
space
end
block:groupSense:3
columns 1
Sense["EasyAR Sense"]
block:groupSenseWrapper
Image["Image<br>Tracker"]
Object["Sparse<br>SpatialMap"]
MotionTracker["Motion<br>Tracker"]
MARCore["ARCore"]
MARKit["ARKit"]
Others["..."]
end
end
block:groupXRSubsystem:2
columns 1
XRSubsystem["XR Subsystems"]
XRSDK["Unity XR SDK"]
end
block:groupSystem:6
columns 1
System["System library"]
block:groupSystemWrapper
space
AREngine["AR Engine<br> Library "]
space
ARCore["ARCore<br> Library "]
space
ARKit["ARKit<br> Library "]
space
end
end
SensePlugin --> App1
SensePlugin --> App2
ARF --> App2
ARF --> App3
groupSense --> SensePlugin
groupAREngineInterop --> SensePlugin
AREngine --> groupAREngineInterop
XRSubsystem --> ARF
XRSubsystem --> XRI
ARCore --> MARCore
ARKit --> MARKit
ARCore --> XRSDK
ARKit --> XRSDK
style groupApp fill:none,stroke:none,stroke-width:0px
style groupAppWrapper fill:none,stroke:none,stroke-width:0px
style groupSensePlugin fill:none,stroke:none,stroke-width:0px
style groupARF fill:none,stroke:none,stroke-width:0px
style groupXRI fill:none,stroke:none,stroke-width:0px
style AREngineInterop fill:none,stroke:none,stroke-width:0px,color:#fff
style Sense fill:none,stroke:none,stroke-width:0px,color:#fff
style groupSenseWrapper fill:none,stroke:none,stroke-width:0px
style XRSubsystem fill:none,stroke:none,stroke-width:0px,color:#fff
style System fill:none,stroke:none,stroke-width:0px
style groupSystemWrapper fill:none,stroke:none,stroke-width:0px
classDef EasyAR fill:#6e6ce6,stroke:#333,color:#fff
class groupAREngineInterop EasyAR
class groupSense EasyAR
class SensePlugin EasyAR
classDef Unity fill:#636,stroke:#333,color:#fff
class groupXRSubsystem Unity
class ARF Unity
class XRI Unity
EasyAR and AR Foundation are two independent AR frameworks. EasyAR does not depend on AR Foundation to implement its AR capabilities. EasyAR can also utilize system libraries like ARKit and ARCore for motion tracking capabilities. Additionally, EasyAR offers two motion tracking implementations not available in AR Foundation: EasyAR's native motion tracking and motion tracking provided through AR Engine, thus offering broader device support compared to AR Foundation.
Meanwhile, EasyAR can access runtime data from AR Foundation, utilizing its motion tracking capabilities to drive other AR functionalities while AR Foundation is running, thereby providing compatibility with AR Foundation. These functionalities include:
- Mega
- Sparse spatial map
- Dense spatial map
- Image tracking and object tracking using motion fusion
Refer to Motion tracking and EasyAR capabilities for detailed information on the relationship between motion tracking and EasyAR functionalities.
When to use AR Foundation
In most cases, AR Foundation is not necessary, as EasyAR will function properly on a wider range of devices than AR Foundation supports. Typically, consider using AR Foundation in the following two scenarios:
When needing to use ARKit or ARCore features not encapsulated by EasyAR
If you need to use certain features provided by ARCore or ARKit that are not encapsulated in EasyAR, you can use AR Foundation. For example, AR Foundation provides support for ARKit face tracking (ARFaceManager), which EasyAR does not encapsulate.
When using motion tracking implemented by ARCore instead of EasyAR on certain Xiaomi phones with system issues
If you need to use ARCore on all supported Xiaomi and Redmi phones, consider enabling AR Foundation. Due to system issues on some Xiaomi and Redmi phones, EasyAR's ARCore encapsulation does not support these devices, including Mi 9, Mi 10, Redmi K20, Redmi K30, Redmi K40 series, etc. (this list is incomplete and device support will be continuously updated). On these phones, ARCore will not be used by default under standard configurations. On phones supporting EasyAR motion tracking, EasyAR motion tracking will be used instead.
The performance of EasyAR functionalities is not optimal when using AR Foundation. There are two situations:
- On some Xiaomi and Redmi phones not directly supported by EasyAR, the input data to EasyAR is grayscale images rather than color images, which may affect the performance of some algorithms. Due to the devices' inherent issues, this cannot be resolved through configuration.
- When using Mega, the default configuration used by AR Foundation is not optimal.
Caution
You can modify AR Foundation's ARCameraManager.currentConfiguration to obtain better data input. Enabling ARCoreARFoundationFrameSource.OptimizeConfigurationForTracking can automatically select the best ARCameraManager.currentConfiguration. However, note that some phones (such as Xiaomi Mi 10) have inherent issues where they fail to capture images after modifying configurations, rendering EasyAR unusable (the application has a background image but EasyAR functionalities show no response). Therefore, enabling this is generally not recommended. If used, ensure a fallback plan is in place for when EasyAR becomes unusable.
Headset support
Due to insufficient data interfaces provided by the Unity XR framework, EasyAR does not support headsets through the Unity XR framework.
On headsets supporting the Unity XR framework, EasyAR will support the use of Unity.XR.CoreUtils.XROrigin through XR Core Utilities, but it does not use the Unity XR framework to implement headset support. EasyAR does not affect the functionalities of XR Interaction Toolkit, which can be used normally as long as the device supports it.
Generally, headset manufacturers provide their own SDKs or system interfaces to supply this data. EasyAR supports headsets through system interfaces and manufacturer SDKs. Sometimes these SDKs are not fully public, and EasyAR collaborates with manufacturers to provide complete support. Headset support in Unity introduces the headsets supported by EasyAR and their usage methods.
Next steps
- Learn how to enable AR Foundation in EasyAR projects
- Learn about AR Foundation scene configuration and usage in EasyAR projects
- Learn how to automatically switch AR Foundation based on device support