We are very excited to announce Vulkan support for Oculus Quest in Unity! In an effort to provide our developers with the latest advances quickly, Vulkan support is available in Unity 2019.3 in an experimental state.
What is Vulkan?Mobile VR has been using OpenGL ES as its graphics API since its infancy, but lower-level APIs such as Vulkan give developers more flexibility and lower rendering overhead. Vulkan is a fairly new graphics API, with numerous features that make it an improvement over OpenGL ES.
Unlike OpenGL ES, Vulkan is a stateless API, meaning that there is no underlying state that the driver needs to store between commands. Vulkan drivers perform little to no error checking and therefore have to do less work whenever a draw call or any command is submitted. The flexibility benefits of Vulkan also make it extremely valuable to VR developers. These combined effects of added performance and control afforded to the developer make Vulkan a very attractive graphics API for use on Quest.
Why Experimental?We are labeling this release as experimental to signify that the quality and performance level is not yet ready for use in released Quest apps, as there are a number of known issues listed below. We intend to use this experimental period to gather feedback from the community on performance and stability in real world situations.
This release includes our advanced rendering features: Multiview and Fixed Foveated Rendering (FFR). Additionally, with the performance benefits of Vulkan specified above, we’re expecting, in the coming months, to eventually be able to achieve ~10% CPU render cost performance improvements.
However, these performance improvements are not guaranteed for all apps right now, hence the experimental label. In fact, in the currently released version of 2019.3, some apps may indeed perform slightly worse on Vulkan than GL. We have identified several performance bottlenecks and optimization opportunities and expect the performance to continue to improve in the near future.
If you are kicking off a new project, or want to get a jump on trying out these new features, we encourage you to try Vulkan with Quest, and report any bugs you might encounter. It will enhance our ability to bullet-proof the implementation. We are currently hard at work to fix the known issues and stabilize the product.
Once the functionality and performance bugs are addressed, we will remove the experimental label and Vulkan will become our recommended graphics API for Quest development.
Getting Started with Vulkan support on Unity for Oculus QuestIn 2019.3, Unity is moving to a new XR Management package model. Vulkan will only be supported in 2019.3 onwards when using the Oculus XR Plugin with the XR Plugin Management system. To enable Vulkan requires a few changes to settings, and existing projects should easily convert to the new XR Management system.
First, navigate to Package Manager and make sure the “Oculus Android” package is not installed. Next, under Project Settings, go to “XR Plugin Management”. Make sure the Android Tab is selected under XR Plugin Management. Install the “Oculus XR Plugin”, and have your project use it by selecting the “Oculus Loader” in the “Plugin Providers” region. Finally, to configure Oculus-specific settings, navigate to the “Oculus” tab (lower left hand corner in the below image).
And to select Vulkan as your graphics API, navigate to Project Settings->Player->Other Settings->Graphics APIs, and make Vulkan the 1st choice.
Using Vulkan with the Universal Render PipelineFor now, use of the URP with Vulkan is not entirely stable and may have functionality and performance bugs. When using Vulkan, we expect URP functionality to slightly lag behind built-in RP functionality, simply due to the current high volume of Quest developers using the built-in RP compared to the URP. However, we absolutely see the URP as a high priority going forward, and we expect to stabilize use of the URP with Vulkan over the next several months.
Namely, Vulkan will only work with the URP 7.2.0 package, releasing in a few weeks.
Current Known Unity Vulkan Issues- Sporadic FFR flicker bug*
- Clearing when using Multiview may have rendering artifacts (affects splash screens)*
- In certain cases, using Multiview with the built-in RP falls back to multi-pass rendering
- Text/SDF shaders don’t yet work with Multiview
- Depth buffer is being resolved (stored), causing a 1-3 ms GPU cost per frame
- Memory usage is not fully optimized. For MSAA apps, up to ~150-250 MB extra memory
- Memory leak of 25-50 MB when eye textures are reallocated
- Mixed Reality Capture not working*
- URP is unstable (see above)*
- Compositor layers (OVROverlay) not working
- Using Graphics Jobs is unstable
- Perf tools aren’t fully supported yet (e.g., in Renderdoc, per-draw call timings don’t function as intended, while MSAA apps may run out of memory when being captured. For stable captures, make sure to turn off MSAA)
* Fix implemented and waiting to ship
FAQsQ. Will Vulkan improve the GPU performance of my app?
A. In nearly all cases, no. Vulkan is a graphics API to generate the GPU commands. The GPU still has to execute those commands in a similar manner in which it would if your graphics API was OpenGL ES. However, for the reasons stated above, CPU render-thread performance can certainly be improved.
Q. Are you going to support Vulkan API on Oculus Go?
A. Unfortunately, the Oculus Go is using an older GPU and graphics driver, and we could not deliver Vulkan with the necessary stability and performance. We worked closely with our graphics driver provider to bring Vulkan support to Oculus Quest.
Q. I found issues when using Vulkan in my Quest project. How should I report it?
A. Please join the discussion on
the Oculus Developer Forums.