Best practices for AR session for Mega
This article explains how to create and configure AR sessions for Mega to achieve optimal performance across different device types.
Before you begin
- Understand the basic concepts, components, and workflow of AR session
- Learn how to create session
Default configuration session
For most applications, using the default Mega session configuration is recommended. These configurations have been optimized for common usage scenarios.
The default session supports the following device types:
- Devices supporting 6DoF motion tracking (some modern phones and headsets)
- Devices supporting 5DoF inertial navigation (most Android phones with gyroscopes and accelerometers)
Right-click in 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 as follows:
ARSessionFactory.CreateSession(ARSessionFactory.ARSessionPreset.MegaBlock_MotionTracking_Inertial)
This session uses the MegaBlock_MotionTracking_Inertial preset:
- Frame source components and their order can be referred to in the frame data source group corresponding to the MegaBlock_MotionTracking_Inertial preset in Preset AR Session Frame Data Source Group
- MegaTrackerFrameFilter.MinInputFrameLevel is FiveDof
- MegaTrackerFrameFilter.ServiceType is Block
Choose different presets
Besides the default Mega session configuration, you can select different presets to create sessions based on specific requirements. Their main difference lies in supported device types.
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
Mega operates differently on various device types. For details, refer to Devices and platform applications supported by Mega.
Next steps
Related topics
- Read Frame data sources to understand basic concepts and runtime frame source selection
- Read Add a group of frame data sources to learn configuration and usage of source groups
- Read Devices and platform applications supported by Mega to understand supported devices and operational effects