Best practices for AR session on Mega
This article introduces how to create and configure an AR session for Mega to achieve optimal performance on different types of devices.
Before you begin
- Understand the basic concepts, components, and workflow of AR Session
- Learn how to create a session
Default session configuration
For most applications, it is recommended to use the default Mega session configuration, which has been optimized for common usage scenarios.
The default session supports the following types of devices:
- Devices with 6DoF motion tracking (some modern smartphones and headsets)
- Devices with 5DoF inertial navigation (most Android phones with gyroscopes and accelerometers)
Right-click on a blank space in the Hierarchy view, and create a default Mega session via the menu EasyAR Sense > Mega > AR Session (Mega Block Default Preset).
The corresponding script code is:
ARSessionFactory.CreateSession(ARSessionFactory.ARSessionPreset.MegaBlock_MotionTracking_Inertial)
This session uses the MegaBlock_MotionTracking_Inertial preset:
- Frame source components and their ordering can be referred to in the frame source group for the MegaBlock_MotionTracking_Inertial preset under preset AR session frame source groups
- MegaTrackerFrameFilter.MinInputFrameLevel is FiveDof
- MegaTrackerFrameFilter.ServiceType is Block
Choosing different presets
In addition to the default Mega session configuration, you can also select different presets to create a session based on specific requirements. The main differences lie in the types of supported devices.
The optional presets when creating a session using the menu and ARSessionFactory.CreateSession(ARSessionFactory.ARSessionPreset, ARSessionFactory.Resources) include:
- MegaBlock_MotionTracking
- For frame-source components and their ordering, refer to the frame-source group corresponding to the MegaBlock_MotionTracking preset in preset ar session's frame-source groups
- MegaTrackerFrameFilter.MinInputFrameLevel is SixDof
- MegaTrackerFrameFilter.ServiceType is Block
- MegaBlock_MotionTracking_Inertial (default)
- For frame-source components and their ordering, refer to the frame-source group corresponding to the MegaBlock_MotionTracking_Inertial preset in preset ar session's frame-source groups
- MegaTrackerFrameFilter.MinInputFrameLevel is FiveDof
- MegaTrackerFrameFilter.ServiceType is Block
- MegaBlock_MotionTracking_Inertial_3DOF
- For frame-source components and their ordering, refer to the frame-source group corresponding to the MegaBlock_MotionTracking_Inertial_3DOF preset in preset ar session's frame-source groups
- MegaTrackerFrameFilter.MinInputFrameLevel is ThreeDof
- MegaTrackerFrameFilter.ServiceType is Block
- MegaBlock_MotionTracking_Inertial_3DOF_0DOF
- For frame-source components and their ordering, refer to the frame-source group corresponding to the MegaBlock_MotionTracking_Inertial_3DOF_0DOF preset in preset ar session's frame-source groups
- MegaTrackerFrameFilter.MinInputFrameLevel is ZeroDof
- MegaTrackerFrameFilter.ServiceType is Block
Note
Mega performs differently on various types of devices. For details, refer to Mega-supported devices and platform applications.
Next steps
Related topics
- Read Frame data sources to understand the basic concepts of frame data sources and the runtime selection process
- Read Add a group of frame data sources to learn how to configure and use data source groups
- Read Mega-supported devices and platform applications to learn about the devices supported by Mega and its performance on different devices