Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

SteamVR + Multiple cameras

Discussion in 'AR/VR (XR) Discussion' started by onelivesleft, Jan 24, 2017.

  1. onelivesleft

    onelivesleft

    Joined:
    Nov 16, 2016
    Posts:
    3
    I'm having a problem using multiple cameras to render my scene. I have three cameras rendering to the HMD like this (Target Eye set to Both):

    Camera 0: Depth = 0, Clear = Skybox, Mask = Nothing,
    Camera 1: Depth = 1, Clear = Depth Only, Mask = Some Stuff
    Camera 2: Depth = 2, Clear = Don't Clear, Mask = Some Other Stuff

    Camera 2 is for some visual FX: splitting cameras 1 & 2 like this means I can apply different post effects to them.

    The problem is Camera 2 is ignoring the depth buffer and is drawing everything, regardless of whether its behind something already rendered by camera 1.

    If I use this setup to render to the desktop window it works fine, so it seems to be HMD specific.
     
  2. deraggi

    deraggi

    Joined:
    Apr 29, 2016
    Posts:
    88
    Hi, I have a similar requirement. Were you able to solve this?
     
  3. onelivesleft

    onelivesleft

    Joined:
    Nov 16, 2016
    Posts:
    3
    No, sorry. I worked out a different way of getting the effect I wanted (which was awful: reassigning all the materials in the game on the fly), but I never got the cameras to work correctly. If you find a solution then please post back here!