Camera permission handling
Calibration options can be controlled through PermissionController or through ARTV configuration.
Handling camera permissions
By default the PermissionCheck scene is enabled in Build Settings and has build order index 0. This scene should remain included in build settings (option should remain checked) since we need camera app permission to display AR content. The PermissionCheck scene contains a PermissionController gameobject that allows control over what scene will be loaded next and some visual changes to the Permission Screen UI. To utilize Camera permissions the PermissionUtility class can also be used directly.
Permission Stage Controller
Changing the scene that is being loaded after PermissionCheck is done: The default MainContent scene (build index 1) can be changed by going to Permission Stage Controller → AR scene index and change it to the desired scene build index.
Permission Tip Behaviour
Permission Tip Behaviour allows for visual changes to the PermissionCheck UI: The following fields contain images that can be changed:
- Native Dialog Android/iOS
- Settings Tip Android/iOS.
The images that will replace the ones currently in use should maintain roughly the same aspect ratio and resolution.
TextTips allow for changes to the text that is displayed in the UI.
In the ARTV configuration panel navigate to Camera pose method → AR foundation Installer. There are two calibration methods available here:
- ARFoundation Installer Background Calibration
- ARFoundation Installer Pseudo Calibration
Background calibration is the most stable form of calibration. It requires more time to complete, time that varies depending on device performance. It requires a successful ground plane detection and the TV should remain detected (visible on camera view) for the duration of calibration. In case the TV is not detected anymore during this phase, calibration will be paused until TV detection is resumed.
Pseudo Calibration is the fastest form of calibration. It requires a successful ground plane detection but it will only take 1-2 seconds for the calibration phase to complete. It does this by estimating the position of the TV screen. One of the disadvantages of this technique is not knowing the size of the TV screen so the assets will be sized according to the measurements provided in Unity.
Choosing the appropriate UI used during calibration
The Calibration UI is built in the Tutorial prefab. There are three versions of tutorial prefab: Tutorial, TutorialNoCalibration, TutorialPseudoCalibration, named accordingly to what they do.
- Tutorial - is a prefab of full tutorial (plane detection + background transform calibration). It is finished after background calibration is complete. Requires Background Calibration.
- TutorialNoCalibration - consists of only scan the floor stage (plane detection). It is finished almost immediately after scan the floor was successful. No calibration method is being used.
- TutorialPseudoCalibration - consists of scan the floor and screen border detection stage. It is finished after pseudo calibration is complete (generally when screen borders are detected). Requires Pseudo Calibration. Once the appropriate UI has been chosen, drag and drop the corresponding prefab onto the main scene.