Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


Configure shader optimizations for Meta Quest

Configure additional shader optimizations to improve graphics performance on Meta Quest.
Read time 2 minutesLast updated 18 days ago

Configure additional shader optimizations to improve graphics performance on Meta Quest.
Unity automatically enables some shader optimizations for Meta Quest build targets to reduce GPU frame time, shader instruction count, and memory bandwidth, and to improve GPU occupancy. Unity also provides additional shader optimizations that you can configure in your project, as described in the following section.
Unity applies enabled optimizations to the Universal Render Pipeline’s (URP) prebuilt shaders (Lit, Simple Lit, 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.

Configurable shader optimizations

When you Configure the Meta Quest build profile, Unity automatically applies some shader optimizations to reduce GPU frame time. You can also configure the following additional shader optimizations in your project:

Optimization

Description

Skip shadow map lookups for backfacing surfacesSkips shadow map lookups on surfaces that face away from the shadow-casting light.
Skip lighting calculations for backfacing pixelsSkips lighting calculations for pixel surfaces that face away from the shadow-casting light.
Light evaluationsWhen 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.
Forward light loop optimizationEnables a point-light-only forward light loop variant on Meta Quest for batches with no affecting spotlights. This reduces per-light shader work and improves GPU efficiency.
Light loop unrollWhen 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 queryOptimizes camera projection query to streamline checks for whether the active camera 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