EasyAR support for Unity XR framework
EasyAR does not rely on the Unity XR framework to provide AR functionality, but it can support some component packages in the Unity XR framework, so that when using EasyAR's AR features in Unity, you can take advantage of the functionality provided by the Unity XR framework. The following content introduces EasyAR's support for the Unity XR framework and under what circumstances you might consider using AR Foundation.
Unity XR support
Unity supports XR development through its plugin framework and a series of feature packages and toolkits. EasyAR also supports these Unity XR component packages, allowing the use of Unity XR framework features when utilizing EasyAR's AR functionality in Unity.
EasyAR supports the following Unity XR component 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 functionality. Therefore, when there is no need to use Unity XR components such as AR Foundation, these component packages do not need to be installed, and EasyAR can still work normally on supported devices.
AR Foundation support
AR Foundation is Unity's AR development framework, with its AR features 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 rely on AR Foundation to implement its AR functionalities. EasyAR can also utilize system libraries such as ARKit and ARCore to achieve motion-tracking capabilities. Additionally, EasyAR provides two motion-tracking implementations that AR Foundation does not offer: EasyAR's own motion-tracking implementation and motion-tracking provided by AR Engine, thereby delivering broader device support compared to AR Foundation.
At the same time, EasyAR can access runtime data from AR Foundation and leverage its motion-tracking capabilities to drive other AR functionalities while AR Foundation is running, ensuring compatibility with AR Foundation. These functionalities include:
- Mega
- Sparse spatial mapping
- Dense spatial mapping
- Image tracking and object tracking using motion fusion
For more details on the relationship between motion tracking and EasyAR functionalities, refer to Motion tracking and EasyAR functionalities.
When to use AR Foundation
In most cases, you do not need to use AR Foundation, as EasyAR will work properly on a wider range of devices than those supported by AR Foundation. Generally, you can consider using AR Foundation in the following two scenarios:
When you need to use ARKit or ARCore features not encapsulated by EasyAR
If you need to use some 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 is not encapsulated by EasyAR.
When using ARCore instead of EasyAR's motion tracking on some Xiaomi phones with system issues
If you need to use ARCore on all Xiaomi and Redmi phones that support ARCore, you can consider enabling AR Foundation. Due to system issues on some Xiaomi and Redmi phones, EasyAR's ARCore encapsulation does not support these devices, including the Mi 9, Mi 10, Redmi K20, Redmi K30, Redmi K40 series, and more (this list is incomplete, and device support will be continuously updated). On these phones, ARCore will not be used by default, and EasyAR motion tracking will be used on phones that support it.
When using AR Foundation, EasyAR's performance is not optimal. There are two scenarios:
- On some Xiaomi and Redmi phones that are not directly supported by EasyAR, the input to EasyAR is grayscale images instead of color images, which may affect the performance of some algorithms. Due to the device's own 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 (e.g., Xiaomi 10) have issues and may fail to capture images after modifying the configuration, rendering EasyAR unusable (the app may display an image background but EasyAR features will not respond). Therefore, it is generally not recommended to enable this option. If you do use it, ensure you have a fallback plan in case EasyAR becomes unusable.
Headset support
Since the Unity XR framework does not provide sufficient data interfaces, EasyAR does not support headsets through the Unity XR framework.
On headsets that support 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 functionality 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 offer this data, and EasyAR supports headsets through these 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 how to use them.
Next steps
- Learn how to enable AR Foundation in EasyAR projects
- Learn about AR Foundation scene setup and usage in EasyAR projects
- Learn how to automatically switch AR Foundation based on device support