Search Unity

Oculus Rift transition between 2 cameras

Discussion in 'AR/VR (XR) Discussion' started by yotamrozin, Feb 25, 2017.

  1. yotamrozin

    yotamrozin

    Joined:
    Mar 25, 2016
    Posts:
    1
    Hi guys,

    I'm desperately trying to transition between two OVR cameras (as in, turn the opacity of one camera from 1 to 0 and the other from 0 to 1). I have been trying to use the ScreenWipes but to no avail. It just flicks from one camera to the other in one frame. I believe that this has something to do with Render Textures?

    Any kind of help would be greatly appreciated, Thanks! :)
    This is my Cross Fade scripts:

    Code (CSharp):
    1. public IEnumerator CrossFadePro ( Camera cam1, Camera cam2, float time )
    2.     {
    3.            if (!renderTex)
    4.         {
    5.             renderTex = new RenderTexture(Screen.width, Screen.height, 24);
    6.         }
    7.        
    8.         cam1.targetTexture = renderTex;
    9.         tex = renderTex;
    10.         CameraSetup (cam1, cam2, true, true);
    11.        
    12.         // Debug.Log("CrossFadePro() begun");
    13.         yield return StartCoroutine( AlphaTimer( time ) );
    14.        
    15.         // Debug.Log("CrossFadePro() finished");
    16.         cam1.targetTexture = null;
    17.         renderTex.Release();
    18.         CameraCleanup (cam1, cam2);
    19.     }
     
  2. EstudioVR

    EstudioVR

    Joined:
    Jul 26, 2013
    Posts:
    127
    look into Camera Fade Pack in Asset Store. Works very well for me