Version: 2022.1
Universal Render Pipeline compatibility in XR
Single Pass Instanced rendering and custom shaders

Stereo rendering

VR and most MR devices require rendering the Unity sceneA Scene contains the environments and menus of your game. Think of each unique Scene file as a unique level. In each Scene, you place your environments, obstacles, and decorations, essentially designing and building your game in pieces. More info
See in Glossary
in stereo. Unity XR supports two stereo render modes:

  • Multi-pass: in this mode, Unity renders the scene twice, performing a pass for each eye. This mode provides the widest compatibility with existing shadersA program that runs on the GPU. More info
    See in Glossary
    and rendering utilities, but is the slower of the two modes.
  • Single pass instanced: in this mode, Unity renders the scene in a single pass using instanced draw calls. This mode greatly decreases CPU usage and slightly decreases GPU usage compared to rendering the scene twice.

Note: The earlier technique of rendering the scene into a double-wide texture using a single render pass is no longer available.

Set the render mode

You can find the Render mode setting under XR Plug-inA set of code created outside of Unity that creates functionality in Unity. There are two kinds of plug-ins you can use in Unity: Managed plug-ins (managed .NET assemblies created with tools like Visual Studio) and Native plug-ins (platform-specific native code libraries). More info
See in Glossary
Management
in Player SettingsSettings that let you set various player-specific options for the final game built by Unity. More info
See in Glossary
. Each XR provider plug-in provides its own setting, if it supports different render modes.

To set a render mode:

  1. Open Project Settings (menu: Edit > Project Settings).

  2. Expand the XR Plugin Management section, if necessary.

  3. Select the settings page for the relevant provider plug-in.

  4. Choose a mode from the list.


    Render mode options in the MockHMD provider plug-in

Note: Some plug-ins name the setting Stereo Rendering Mode.

Supported platforms

  • PlayStation VR
  • Oculus Rift (DirectX 11)
  • HoloLens
  • Magic Leap
  • Android devices that support the Multiview extension
  • For DirextX on desktop, the GPU must support Direct3D 11 and the VPAndRTArrayIndexFromAnyShaderFeedingRasterizer extension.
  • For OpenGL on desktop, the GPU must support one of the following extensions:
    • GL_NV_viewport_array2
    • GL_AMD_vertex_shader_layer
    • GL_ARB_shader_viewport_layer_array

Note: Unity doesn’t support Single Pass Stereo Instancing in the Legacy 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
when using Deferred Rendering.

Universal Render Pipeline compatibility in XR
Single Pass Instanced rendering and custom shaders