Version: Unity 6.5 Alpha (6000.5)
Language : English
Packages and templates for Meta Quest development
Run an XR application

Shader optimizations for Meta Quest

Understand shaderA program that runs on the GPU. More info
See in Glossary
optimizations to improve graphics performance on Meta Quest.

Unity provides shader optimizations for Meta Quest build targets. Meta Quest shader optimizations reduce GPU frame time and shader instruction count, lower memory bandwidth, and provide better GPU occupancy to improve graphics performance in your project.

Unity applies enabled optimizations to the Universal Render PipelineA series of operations that take the contents of a Scene, and displays them on a screen. Unity lets you choose from pre-built render pipelines, or write your own. More info
See in Glossary
’s (URP) prebuilt shaders (Lit, Simple Lit, Unlit, Shader Graph nodes) and Scriptable Render Pipeline (SRP) library functions. If your project uses custom shaders that rely on SRP library functions, your custom shaders also inherit these optimization techniques for the Meta Quest platform.

Build profile shader optimizations

When you select the Meta Quest build profile, Unity enables some shader optimizations automatically to reduce GPU frame time on Meta Quest devices.

The following optimizations are automatically applied when you select the Meta Quest build profileA set of customizable configuration settings to use when creating a build for your target platform. More info
See in Glossary
:

Optimization Description
Skip shadow map lookups for backfacing surfaces Skips shadow map lookups on surfaces that face away from the shadow-casting light.
Skip lighting calculations for backfacing pixels Skips lighting calculations for pixelThe smallest unit in a computer image. Pixel size depends on your screen resolution. Pixel lighting is calculated at every screen pixel. More info
See in Glossary
surfaces that face away from the shadow-casting light.
Light evaluations When attenuation is <=0, the Forward and Forward+ renderers skip lighting calculations when a light doesn’t affect the current pixel. This reduces unnecessary light evaluations to improve GPU performance.
Light loop unroll When a URP Asset has one additional light per object, shaders automatically unroll the light loop. This improves runtime performance but increases shader variant count and build times.
Note: To enable this optimization, set the URP Asset’s Per Object Limit to 1.
Camera projection query Optimizes camera projection query to streamline checks for whether the active cameraA component which creates an image of a particular viewpoint in your scene. The output is either drawn to the screen or captured as a texture. More info
See in Glossary
uses perspective or orthographic projection. With this optimization, the camera projection type always resolves as perspective projection.
Important: If your shaders use orthographic cameras, you must enable the _ META_QUEST_ORTHO_PROJ shader keyword to restore correct orthographic detection. This optimization increases shader variant count and build times.
To enable the _ META_QUEST_ORTHO_PROJ keyword, go to the Keyword Declaration Overrides in the Shader Build Settings (menu > Edit > Project Settings > Graphics tab). Expand the _ META_QUEST_ORTHO_PROJ keyword, and check the boxes next to _ and META_QUEST_ORTHO_PROJ and Apply your changes.

Additional resources

Packages and templates for Meta Quest development
Run an XR application