Search Unity

Question Both Eyes in Render Texture

Discussion in 'VR' started by atmuc, Jun 12, 2022.

  1. atmuc

    atmuc

    Joined:
    Feb 28, 2011
    Posts:
    1,162
    When I set a render texture to the VR camera, It renders just the left eye. I use Unity 2021.3, URP, single pass instanced mode. How can I get both eyes or just the right eye in render texture?
     
  2. arfish

    arfish

    Joined:
    Jan 28, 2017
    Posts:
    782
  3. atmuc

    atmuc

    Joined:
    Feb 28, 2011
    Posts:
    1,162
    Hi,

    Thanks for this info. I didn't know it because it is not exposed to the inspector. I tried all options but the result is the same. I see just the left eye. I couldn't any usage example on the internet about RenderTexture.vrUsage.
     
  4. homoinanis

    homoinanis

    Joined:
    Sep 29, 2020
    Posts:
    7
    I have searched a lot on the internet. I can save you time. One day as of this post Unity offers absolutely nothing to get a single render texture with stereoscopic view using Single Instance.

    But of course, there is the issue that if you want to make a relatively complex game Single Instance is practically mandatory.

    The only solution I have found is also quite simple: use two cameras for each of the eyes of the HMD viewer. So, for each stereoscopic texture that we want, for example a portal, we will have to create two cameras that will track the position of the eyes in a relative way, recording the texture in two render textures that we can assign to each of the textures of a shader that unify in a single vision.
     
  5. atmuc

    atmuc

    Joined:
    Feb 28, 2011
    Posts:
    1,162
    When you use URP, you cannot use a camera for a specific eye.