Proper working configuration for using Vulkan in a project for Quest/Quest2?

I’ve been struggling with the 4.25 (oculus branch) and development for the Quest
With some trial and error I managed to set everything up to work with ES 3.1.

As the project is getting bigger and more complex, I wanted to test if using Vulkan might achieve better performance in some problem areas and also be ready when openGL gets dropped (which is happening soon, I guess).

However I’ve (again) hit a brick wall when configuring the project.
I’m trying again through trial and error, since this is all somewhat of novelty (both Quest and Vulkan for mobile in UE) and I’m definitely not a superstar gpu developer (I’m hardly a dev at all lol). It’s almost completely undocumented apart from a couple of blog posts and some (non VR specific) UE documentation entries.

Here are some specific questions, but any kind of info is more than welcome:

  1. the UE documentation says ‘mobile HDR’ should be enabled (link: VulkanMobileRenderer) - however it’s obviously standard practice to not use mobile HDR when doing VR for performance reasons.
  2. Even if I wanted to disable mobile HDR it seems MSAA crashes the editor if mobile HDR is disabled. I’ve noticed the same thing with ES 3.1, however **‘mobile multi-view’ **is the culprit there (so everything works fine, but crashes the editor if both multiview and msaa are enabled
  3. MSAA seems to be working (at least in the preview, don’t know about the built app on quest yet) even if forward rendering is disabled! Please excuse my lack of knowledge, I was under the impression that in UE it only works with the forward renderer (also stated in the docs)
  4. Should I be using forward rendering with Vulkan at all (assuming msaa works without it)?

The resources available are sadly a bit too technical for me (for example: I’m aware this is stil experimental, but if anyone can shed some light, that’d be awesome because it seems question regarding this are left pretty much unanswered on the Oculus forum, github, but also the UE answerhub.

To (partly) answer one of my claims, this forum post: “ES2.0 and ES3.1 are pure forward renderers” and then the UE editor forward shading tooltip: “enable forward shading on desktop…”

This makes sense, I guess, considering the differences in how mobile and desktop gpus render (which I only have a very general idea on, obviously).

Did you ever figure out for the Quest 4.25 Unreal branch what settings play nice and are the most optimal?
To further complicate things certain nodes in the material graph like Depth Fade wont’ work if you don’t use Vulkan.

I have some notes from configuring a new Quest 1 + 2 project on Unreal Engine 4.26.2. If you use the Vulkan Mobile Preview (PIE), it seems that MSAA has to be off to avoid an assertion failure that I guess is meant to prevent memoryless textures from being used.

On Android builds, Gradle 4.0.0 is used automatically, which (doesn’t seem to detect the target Android SDK version properly and) requires a Android SDK version higher than 25. Quest 1 + 2 are now on Android 10, so the target and minimum SDK can be set to 29 to avoid this issue.

In any case, everything was confusing for a first time user, but I followed the Unreal Quick Start from Oculus guide at first. A newer Android SDK like version 29 is required unless you can make gradle work with special config changes. Next, I enabled wireless ADB and got a simple build to work. Then, I enabled “Support Vulkan” for Android. I enabled Vulkan Mobile Preview (PIE) even though it doesn’t seem that useful. If you use it, I guess you have to turn Mobile MSAA off.

On a related note, I don’t think the Engine/Extras/Android/SetupAndroid.bat does anything useful if you already have the Android SDK installed in a standard way using Android Studio. In any case, the following seems to be a correction that is needed in that script. The cmdline-tools should be preferred over the deprecated tools folder or there will be a crash for missing libraries in Java 8+. Variable expansion also needed to be fixed, so ENABLEDELAYEDEXPANSION has to be added as another option to setlocal at the top of the script.

set SDKMANAGER=%STUDIO_SDK_PATH%\cmdline-tools\latest\bin\sdkmanager.bat
	echo Using sdkmanager: %SDKMANAGER%
) ELSE (
	set SDKMANAGER=%STUDIO_SDK_PATH%\tools\bin\sdkmanager.bat
		echo Using sdkmanager: !SDKMANAGER!
	) ELSE (
		echo Unable to locate sdkmanager.bat. Did you run Android Studio and install cmdline-tools after installing?
		exit /b 1

There’s some debate if the Quest 2 screen can benefit from HDR or if it’s asking too much of the LCD. I suppose leaving Mobile HDR disabled and MSAA off is fine until I can try it out later.