Computer Graphics for Virtual  
and Augmented Reality  
Lecture 07 Augmented Reality in Unity  
(Project Setup)  
Edirlei Soares de Lima  
<edirlei.lima@universidadeeuropeia.pt>  
Augmented Reality in Unity  
Unity XR system offers support for Virtual Reality (VR), Mixed  
Reality (MR), and Augmented Reality (AR).  
Augmented Reality in Unity  
Project Setup  
Setup a new AR Project in Unity:  
1
. Create new 3D Project.  
2
. Install the "AR Foundation" in the Package Manager (Window ->  
Package Manager).  
3
4
. Install the "ARCore XR Plugin" in the Package Manager (Window ->  
Package Manager).  
. Open the Project Settings (Edit -> Project Settings) and select the XR  
Plug-in Management.  
In the Android tab, enable the "ARCore" Plug-in Provider.  
Select the ARCore settings and set Depth to “optional” (most current ARCore  
capable devices do not have depth cameras).  
5
. Open the Build Settings and Switch the target platform to Android  
(File -> Build Settings).  
Project Setup  
Setup a new AR Project in Unity:  
6
. Open the Project Settings window (menu: Edit > Project Settings),  
and select Player. Select the Android settings tab and apply the  
following changes:  
Other Settings -> Rendering: uncheck auto graphics API and remove the Vulkan  
Graphis API.  
Other Settings -> Identification -> Package Name: create unique name for the  
app.  
Other Settings -> Minimum API Level: select API Level 24 or higher (API Level 24 is  
the minimum for AR).  
Other Settings -> Configuration -> Scripting Backend: Select IL2CPP and enable  
the ARM64 architecture.  
Project Setup  
Setup a new AR Project in Unity:  
7
. Remove the default camera from the scene.  
8
. Create the AR Session in the scene (GameObject -> XR -> AR  
Session).  
The AR Session controls the lifecycle of AR app, checks for AR device support,  
manages the state of the session, and provides ways to enable and disable AR.  
9
. Create the AR Session Origin in the scene (GameObject -> XR -> AR  
Session Origin).  
AR Session Origin: applies transformations from trackable features to anchored  
objects.  
AR Pose Driver: controls the position and orientation of the camera according to  
the device’s tracking information.  
AR Camera Manager: manages the camera’s auto focus, activate light estimation,  
allow to switch between the world- and user-facing camera.  
Project Setup  
Setup a new AR Project in Unity:  
1
0. Build the project (File -> Build Settings).  
1
1. Copy the .apk file to an Android Device and install the app.  
You may need to allow app installations from unknown sources in the device  
settings.  
1
2. Run the app.  
It will simply show the camera image in the background.  
Further Reading  
Unity and ARCore Documentation:  
Getting started with AR development in Unity:  
https://docs.unity3d.com/2022.1/Documentation/Manual/AROverview.html  
Getting started with AR Foundation:  
https://developers.google.com/ar/develop/unity-arf/getting-started-ar-foundation