# Supported Unity Packages
# AR Foundation support
The Wikitude SDK Extension - AR Foundation
package provides all necessary assets to ensure support for Unity's AR Foundation.
Furthermore, it is required that the Allow 'unsafe' code
setting is enabled in Player Settings, to enable fast data transfer between AR Foundation and the Wikitude SDK.
# Configuring an AR Foundation scene
Assuming that the extension package is installed, there are three additional steps needed to configure the Wikitude SDK to support any AR Foundation scene:
- Add a GameObject with a Wikitude SDK component and add the camera and the session origin of the AR Foundation components to it (like seen in the image below).
- Set the
Ar Bridge
mode toPlugin
. - Add a GameObject with an
AR Foundation Plugin
component as a child to the Wikitude SDK component.
![AR Foundation Settings](/external/doc/expertedition/assets/img/unity_ar_foundation_settings.f766aa95.png)
After these steps, the Wikitude SDK is ready to work with various AR Foundation features like plane detection, occlusion, light estimation, reflection probes and other features that are listed in Unity's manual for AR Foundation (opens new window).
# AR Foundation Editor Remote
Starting with v9.6, the AR Foundation samples support the third party AR Foundation Editor Remote v4.7.0 and higher from the Asset Store (opens new window). This Editor extension can help to reduce iteration times during development by sending AR data from a remote AR application to the Editor.
The setup is fairly easy. After importing the Asset and installing the remote app with the helper tool located under Plugins/ARFoundationRemoteInstaller/Installer
, the next step is to input the IP address (which is shown on the remote app) into the settings file located under Plugins/ARFoundationRemoteInstaller/Installer
. Additionally, the Enable Cpu Image Raw Planes
option should be disabled to get downscaled images from the remote app.
![AR Foundation Editor Remote settings](/external/doc/expertedition/assets/img/unity_ar_foundation_editor_remote_settings.8d549910.png)
A low Camera Frame Scale
value in the ARFoundationPlugin
component will result in higher framerates but due to the smaller resolution of the image, that is inputted into the SDK, the recognition and tracking quality might not be on the same level as the quality on the deployed application. It is still very helpful to test augmentations in an AR Foundation environment in the Editor.
![AR Foundation Plugin's camera frame scaling settings](/external/doc/expertedition/assets/img/unity_ar_foundation_plugin_camera_frame_scale.f7c9b188.png)
Important
As mentioned above, the tracking quality with a reduced Camera Frame Scale
value might not be representative of the final quality achieved on a mobile device.
# Removing AR Foundation
If the samples (from the Wikitude SDK Extension - AR Foundation
package) were imported into the Assets directory, they should be deleted before removing the AR Foundation related packages. Once the samples are not present in the Assets directory anymore, the following dependencies have to be removed before the Wikitude SDK Extension - AR Foundation
package can be deleted from the project.
- AR Foundation
- ARCore XR Plugin
- ARKit XR Plugin
# Universal Render Pipeline support
Starting with v9.1, the Wikitude SDK includes support for Unity's Universal Render Pipeline (URP) and requires the following package to be installed from the Package Manager
:
- Universal RP v7.2.1 or newer.
# Convert the sample scenes
There are several steps to be done, to convert the sample scenes to work with URP.
Follow these steps as seen in the Universal Render Pipeline Documentation (opens new window)
A Renderer Feature has to be added as seen in the AR Foundation Documentation (opens new window), to ensure AR Foundation is working with the Render Pipeline.
Use the Wikitude URP helper tool available in the
Window
dropdown menu underWikitude > URP Helper
to apply required changes to the sample scenes.
# Manual scene conversion
If you finished steps 1. and 2. in the section above, you can also convert a scene manually by applying these modifications:
- Open your scene and choose the
Main Camera
in the hierarchy. Set theRender Type
of its Camera component toOverlay
in the Inspector. - Choose the
Camera Frame Renderer
in the hierarchy. Add theMain Camera
to the Stack of its Camera component in the Inspector.
Also adjust the shadow settings once in the URP Asset created in step 1.2. in the section above.
- The default
UniversalRenderPipelineAsset
has a relatively high shadow distance of50
. In order to properly work with AR scenes set the distance value in the asset underShadows | Distance
to5
. - Also, apply
Four Cascades
to theShadows | Cascades
option for optimal results.