Best Practices for AR Sessions in Mega
This article describes how to create and configure AR sessions for Mega to achieve the best performance on different types of devices.
Before You Start
- Understand the basic concepts, components, and workflows of AR Sessions.
- Learn how to create a session.
Sessions with Default Configuration
For most applications, it is recommended to use the default Mega session configuration. These configurations have been optimized and are suitable for most common use cases.
The default session supports the following types of devices:
- Devices that support 6DoF motion tracking (some modern phones and headsets).
- Devices that support 5DoF inertial navigation (most Android phones with gyroscopes and accelerometers).
Right-click on the blank area in the Hierarchy view, and you can create a default Mega session through the menu EasyAR Sense > Mega > AR Session (Mega Block Default Preset).
The corresponding script code is as follows:
ARSessionFactory.CreateSession(ARSessionFactory.ARSessionPreset.MegaBlock_MotionTracking_Inertial)
This session uses the MegaBlock_MotionTracking_Inertial preset:
- For the frame source components and their sorting, you can refer to the frame source group corresponding to the MegaBlock_MotionTracking_Inertial preset in Frame Source Group of Preset AR Sessions.
- MegaTrackerFrameFilter.MinInputFrameLevel is FiveDof.
- MegaTrackerFrameFilter.ServiceType is Block.
Select Different Presets
In addition to the default Mega session configuration, you can also choose different presets to create a session based on specific needs. The main difference lies 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
- Frame source components and ordering can refer to the frame source group corresponding to the MegaBlock_MotionTracking preset in Preset AR session frame source groups
- MegaTrackerFrameFilter.MinInputFrameLevel is SixDof
- MegaTrackerFrameFilter.ServiceType is Block
- MegaBlock_MotionTracking_Inertial (default)
- Frame source components and ordering can refer to the frame source group corresponding to the MegaBlock_MotionTracking_Inertial preset in Preset AR session frame source groups
- MegaTrackerFrameFilter.MinInputFrameLevel is FiveDof
- MegaTrackerFrameFilter.ServiceType is Block
- MegaBlock_MotionTracking_Inertial_3DOF
- Frame source components and ordering can refer to the frame source group corresponding to the MegaBlock_MotionTracking_Inertial_3DOF preset in Preset AR session frame source groups
- MegaTrackerFrameFilter.MinInputFrameLevel is ThreeDof
- MegaTrackerFrameFilter.ServiceType is Block
- MegaBlock_MotionTracking_Inertial_3DOF_0DOF
- Frame source components and ordering can refer to the frame source group corresponding to the MegaBlock_MotionTracking_Inertial_3DOF_0DOF preset in Preset AR session frame source groups
- MegaTrackerFrameFilter.MinInputFrameLevel is ZeroDof
- MegaTrackerFrameFilter.ServiceType is Block
Note
The performance of Mega varies on different types of devices. For more details, refer to Devices and Platform Applications Supported by Mega.
Next Steps
- Add tracking targets.
- Enable editor tools.
- Add 3D content aligned with the real world.
- Control the tracking process.
Related Topics
- Read Frame Data Sources to understand the basic concepts of frame data sources and the process of selecting frame data sources at runtime.
- Read Add a Group of Frame Data Sources to learn how to configure and use data source groups.
- Read Devices and Platform Applications Supported by Mega to understand the devices supported by Mega and its performance on different devices.