Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.

Setting Stereo Rendering Mode in Unity/Oculus

Discussion in 'AR/VR (XR) Discussion' started by saifshk17, Jul 17, 2020.

  1. saifshk17


    Dec 4, 2016
    I am trying to set the Stereo Rendering Mode to Single Pass for Oculus through Script. The value never gets changed, i.e., it stays the same as "Multi-Pass". Is there a way to set up Stereo Rendering Mode through script during runtime? Thing is if I set it manually to Single-Pass and run the application in Editor, it works fine but then when I stop the run, the settings automatically changes to Multi-Pass.

    Code (CSharp):
    2. using System.Collections;
    3. using System.Collections.Generic;
    4. using UnityEngine;
    5. using UnityEngine.XR;
    7. public class SteoreoRendering : MonoBehaviour
    8. {
    9.     XRSettings.StereoRenderingMode stereoRenderingMode;
    10.     // Start is called before the first frame update
    11.     void Start()
    12.     {
    14.     }
    16.     // Update is called once per frame
    17.     void Update()
    18.     {
    19.         stereoRenderingMode = XRSettings.StereoRenderingMode.SinglePass;
    20.         Debug.Log(stereoRenderingMode);
    21.     }
    22. }
    angela_luo likes this.