Computer Graphics for Virtual  
and Augmented Reality  
Lecture 07 Augmented Reality in Unity  
(Project Setup)  
Edirlei Soares de Lima  
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:  
. Create new 3D Project.  
. Install the "AR Foundation" in the Package Manager (Window ->  
Package Manager).  
. 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).  
. Open the Build Settings and Switch the target platform to Android  
(File -> Build Settings).  
Project Setup  
Setup a new AR Project in Unity:  
. 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  
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:  
. Remove the default camera from the scene.  
. Create the AR Session in the scene (GameObject -> XR -> AR  
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.  
. Create the AR Session Origin in the scene (GameObject -> XR -> AR  
Session Origin).  
AR Session Origin: applies transformations from trackable features to anchored  
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:  
0. Build the project (File -> Build Settings).  
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  
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:  
Getting started with AR Foundation: