Consolidated Setup for Quest Development in Unity
June 17, 2019
The Oculus documentation for setting up for Quest development in Unity is scattered across several pages. This post is my consolidated list of settings to get you up and running quickly. I'm using Unity 2019.1.0f2, which Oculus recommends. Older recommended versions include 2018.4 LTS, or 2017.4 LTS.
Quest Device Setup
Setup Organization
First off you have to setup a developer organization:
-
Make sure you have an Oculus account and are logged into it on the Oculus website and on your Quest.
-
Fill in the appropriate information.
Developer Mode
Next, you need to put your Quest in Developer Mode:
-
Download and start the Oculus app from your phone's app store.
-
In the lower right tap Settings and you should see your Quest listed as "Nearby".
-
Tap the Oculus Quest and the app should connect.
-
Tap the drop down arrow on the right to expand the device settings.
-
Click on More Settings > Developer Mode > and Enable.
Install the Oculus Go ADB Driver (Windows only)
-
Download and unzip this file: https://developer.oculus.com/downloads/package/oculus-go-adb-drivers/
-
Right-click on the .inf file and select Install.
Connect to Computer
-
Connect the Quest via USB and put the headset on.
-
You should be prompted with a message saying "Allow USB Debugging?".
-
Click Always allow from this computer and OK.
Android Setup
Oculus recommends installing Android Studio and using the SDK manager to install the SDK, NDK, JDK. Unity recommends using Unity Hub and installing Android Build Support to guarantee compatibility with Unity. I've found installing through the SDK manager is a hassle to get the correct versions for Oculus and Unity to both be happy, and that using the Android Build Support in Unity works fine. To install it, do the following:
-
Open Unity Hub.
-
Select Installs.
-
For your version, select the menu ⋮ then select Add Modules.
-
Check Android Build Support: Android SDK & NDK Tools and click Install.
ADB Setup
Unity Android Build Support embeds the SDK, NDK, JDK into the Program Files hierarchy for that version of Unity. This includes adb.exe, used for checking device connections, debugging, logging, etc. To use ADB in a command prompt we need to add it to our Windows Environment Variables (sorry, not sure what the process is for Mac).
-
Copy the path to the folder containing adb.exe, for example: C:\Program Files\Unity\Hub\Editor\2019.1.0f2\Editor\Data\PlaybackEngines\AndroidPlayer\SDK\platform-tools
-
Press Windows key and search "Edit the system environment variables" and click the option that shows up.
-
Select System Properties > Advanced > Environment Variables.
-
In System Variables select Path and Edit…
-
Select New and paste this path.
-
Select OK.
Run Command Prompt and enter “adb devices” and you should see it print a serial code followed by “device” to show that it sees the Quest.
Unity Build Settings & Packages
Build Settings
-
Switch platform to Android.
-
Texture Compression: ASTC
-
Development Build: Enable
-
Autoconnect Profiler: Enable (Optional)
-
Script Debugging: Enable
Packages
Install the following packages:
-
Package Manager → Search for and Install Oculus (Android) package.
-
Asset Store → Search for and import the Oculus Integration: https://assetstore.unity.com/packages/tools/integration/oculus-integration-82022
-
A prompt may pop up saying that a newer plugin has been detected. Choose Yes and Restart Unity.
App ID
- In the top menu in Unity choose Oculus → Platform → Edit Settings → Inspector.
- Click the button Create / Find your app on https://dashboard.oculus.com
- Click Create New App
- Click Oculus Go & Gear VR
- Give the app a name and click Save and Continue
- Copy the Application ID.
- Back in Unity in Oculus → Platform → Edit Settings paste the ID in the Oculus Go/Quest or Gear VR field.
Project Settings
Open Edit → Project Settings
Audio
-
DSP Buffer Size: Good Latency.
-
Spatializer Plugin: OculusSpatializer
Graphics
-
For Medium and High Tier set Use Defaults to be disabled.
-
Set Standard Shader Quality to Low for both tiers.
-
If possible, avoid using the standard shaders and use mobile shaders instead.
-
Rendering Path should be Forward Rendering for all tiers (should already be set as default).
-
Consider adding shaders to the Preloaded Shaders list at the bottom. This will impact loading times but, will help avoid needing to load and compile these shaders on demand.
Player → Resolution and Presentation
-
Use 32 bit Display Buffer: Enable
-
Disable Depth and Stencil: Disable
Player → Other Settings → Rendering
-
Auto Graphics API: Disable
-
Graphics APIs:
-
Remove Vulkan API
-
OpenGLES 3 should be the only one.
-
-
Require ES3.1: Enable
-
Require ES3.1+AEP: Enable
-
Multi Threaded Rendering: Enable
-
Static Batching: Enable
Player → Other Settings → Identification
-
Package Name: Enter an appropriate name.
-
Minimum API Level: Android 7.1 ‘Nougat’ (API level 25)
-
Target API: Automatic (highest installed)
Player → Other Settings → Configuration
-
Scripting Backend: IL2CPP
-
API Compatibility Level: .NET 4.x
Player → Other Settings → Optimization
-
Prebake Collision Meshes: Enabled
-
Keep Loaded Shaders Alive: Enabled
-
Optimize Mesh Data: Enabled
Player → XR Settings
-
Virtual Reality Supported: Enabled
-
Virtual Reality SDKs: Oculus
-
Stereo Rendering Mode: Single Pass
Quality
Remove all levels other than Medium, and rename Medium to Quest.
-
Pixel Light Count: 1
-
Texture Quality: Full Res
-
Anti Aliasing: 4x
-
Soft Particles: Disable
-
Realtime Reflection Probes: Enable
-
Billboards Face Camera: Enable
-
Shadows:
-
Hard Shadows Only with Low Resolution
-
or
-
Disable Shadows
-
-
Skin Weights: 2
-
V Sync Count: Don't Sync
Lighting Settings
Oculus recommends: "Avoid Unity’s Default-Skybox, which is computationally expensive for standalone. We recommend setting Skybox to None (Material), and Ambient Source to Color in Window > Lighting. You may also wish to set Camera.clearFlags to SolidColor (never Skybox)."
-
Skybox Material: None
-
Environment Lighting Source: Color
-
Realtime Global Illumination: Disable
-
Lightmapper: Progressive CPU
-
Directional Mode: Non-Directional
Resources
The above steps and settings were compiled from these resources which contain other valuable notes not listed above:
-
Preparing for Android Development: https://developer.oculus.com/documentation/quest/latest/concepts/unity-mobileprep/
-
Maximizing Performance: https://developer.oculus.com/documentation/unity/latest/concepts/unity-mobile-performance-intro/
-
Best Practices: https://developer.oculus.com/documentation/quest/latest/concepts/unity-best-practices-intro/
-
Blog Post with settings listed: https://developer.oculus.com/blog/tech-note-unity-settings-for-mobile-vr/