How To: Game Development Best Practices for Quest 3 using Unreal Engine 5

MarkEntingh
Mon, 07 Oct 2024 06:41:59 +0000
XR Development

Best Installation Path

Use latest Oculus Fork of Unreal Engine 5 (https://github.com/Oculus-VR/UnrealEngine)

Installation instructions: Unreal Engine 5.4.x for Meta Quest VR | Community tutorial

Contains the MetaXR & MetaXRPlatform plugins built-in

Many fixes specific to Meta Quest development that the official Epic build will not have

Includes many template VR projects to help you better understand working with Quest 3 in Unreal Engine

Extra Rendering Settings & built-in features not available in the official Epic build, including:

“Support Mobile Application Space Warp”

“Support XR Soft Occulsions” (for mixed reality passthrough)

Uniform Local Lights more info

Qualcomm Adreno hardware fast path for occlusion queries more info

Will be around 250GB total after you Build the Engine in Visual Studio (compared to 150GB in official UE5.4 download)

Learn more about differences between Epic’s Unreal Engine & Meta’s custom build of Unreal Engine here

Use Meta XR Audio Plugin for 3d spatialization in VR

Installation Instructions: https://developers.meta.com/horizon/documentation/unreal/meta-xr-audio-sdk-unreal-req-setup

Install available Performance Analyzer & Metrics Tools

Installation Instructions: https://developers.meta.com/horizon/documentation/unreal/ts-odh-logs-metrics/#run-perfetto-trace

Important!

In order to correctly test Quest 3 environment on your PC in VR Preview mode, you must do the following or else you will instead have a PC VR experience when in VR Preview mode:
* Click Settings button (Top-right corner in UE5) > Preview Platform > Android Vulkan Mobile.

Rendering Facts

The Quest is a PowerVR tiled renderer

Deferred rendering would perform too poorly on it

Forward rendering is the only option

Static baked lighting is the only viable lighting option for your scene. Fully dynamic lighting is not an option.

Do not use movable lighting unless you add a single movable directional light (read about shadows below).

Use stationary lights to light your character, interactable objects, NPCs, etc. and make sure they do not overlap each other

Never use a stationary or mobile rect light in your level since it is unsupported.

Keep draw calls as low as possible, 100 - 500

All static meshes should only use one material each

All interactive objects / skeletal meshes should also use only one material each

Under Project Settings > Rendering > Mobile, select “Enable GPUScene on Mobile” to improve the performance of your games by rendering the objects that share the same mesh and material multiple times, while sending them to the GPU in as little draw calls as possible

Keep max culled scene poly count under 100k - 250k

Use MSAA for anti-aliasing if you decide to use AA. FXAA & TAA will most definitely blur your scene, so do not use those methods

Watch the following videos to understand development on the Meta Quest better

About Unreal Engine development for the original Quest

About Vulkan for mobile VR development

About Oculus development in Unreal Engine 4

Red Matter 2 Showcase

Playlist about Quest 3 development in Unreal Engine 5

More development resources from developers.meta.com

Performant tone mapping on quest

Baked Lighting

Enabled “Mobile HDR” under Project Settings > Rendering > VR for better lighting (which enables Post Processing for Mobile and will take a small performance hit)

Add at least one Reflection Capture in your level (I use Sphere Reflection Capture)

Under “World Settings” tab, set “Indirect Lighting Quality” to 10 for best baked lighting results (which will slow down light baking but your light maps will be more accurate)

Real-time Shadows

Change the default shadow quality settings for Quest 3 by going to Tools > Platforms > Profiles, selecting Meta_Quest_3 and adding a Console Variable for the Rendering section, setting r.ShadowQuality to 2

Enable “Support Movable Directional Lights” found in Project Settings > Rendering > Mobile Shader Permutation Reduction section

Only use a single directional light for shadows in your level and set the directional light to movable

If you need something like a flashlight in your game, enable “Support Movable SpotlightShadows”

DO NOT:

Do not use “Stereo Foveation Level” or “Dynamic Foveation” in Project Settings > Rendering > VR. This currently crashes UE5.4.4 in VR Preview mode.

(I’ll be updating this topic as I continue working on my own project & understanding more about the nuances of Quest 3 & UE5)

27 posts - 18 participants