Search Unity

Stereoscopic rendering with the Google VR SDK ?

Discussion in 'AR/VR (XR) Discussion' started by jjennings1990, Apr 28, 2017.

  1. jjennings1990

    jjennings1990

    Joined:
    Oct 25, 2012
    Posts:
    132
    Hello Everybody I am building an app for the google daydream that makes use of 2D stereoscopic images. I am having issues figuring out how to set up my Main camera and how to tweak the instances of the left and right eye camera that the API creates.

    Essentially I would like to create a Left eye camera that has a culling mask that only includes the left eye images and a right eye camera that only renders the right eye images.

    Here is my main Camera in the inspector am I missing anything ?
    Screen Shot 2017-04-27 at 4.49.47 PM.png
    Also is there anyway for me to set the Left and Right eye camera culling mask values outside of manipulating them through code ?
     
  2. Selaphiel

    Selaphiel

    Joined:
    Jan 31, 2014
    Posts:
    23
    Click on 'Update Stereo Cameras' you will get two camera as child, then you can set culling mask on both of these cameras.
     
  3. Selzier

    Selzier

    Joined:
    Sep 23, 2014
    Posts:
    652
  4. jjennings1990

    jjennings1990

    Joined:
    Oct 25, 2012
    Posts:
    132
    Hey Everybody I just returned to this and after trying to update the stereo cameras I am still having issues rendering in Stereo . It almost seems like the ToggleCullingMask enum isn't working on builds even though I can see that it's working in editor .

    Here is my main Camera :
    Screen Shot 2017-05-18 at 6.38.30 PM.png

    my left Camera:
    Screen Shot 2017-05-18 at 6.38.39 PM.png

    and my right camera:
    Screen Shot 2017-05-18 at 6.38.49 PM.png

    am I setting something wrong ? Also I am noticing that when I set the target Eye property on the individual eye cameras themselves, they default to whatever the main camera is set to at runtime . If the main camera is targeting both eyes could that be the source of my issues? Is there anyway I can stop The main camera from setting the target eyes of the children cameras at runtime ? Thank you for any and all help .
     
  5. jjennings1990

    jjennings1990

    Joined:
    Oct 25, 2012
    Posts:
    132
    On further investigation the settings work perfectly in editor , however on builds it seems like my cameras culling masks or Stereo settings are being set or the entire stereo camera rig whose settings I set are replaced. has anyone else encountered this ?
     
  6. MaskedMouse

    MaskedMouse

    Joined:
    Jul 8, 2014
    Posts:
    1,092
    are you using Unity 5.6 with native integration? Then this won't work because there is no left and right camera in the run-time build, only in the editor.

    GVR 1.5 also removes the GVR stereocontroller, eye and gvrmain etc scripts it's being replaced by an editor script that only moves the camera around in monoscopic view.

    You can either mimic the setup by having a Main Camera, Left Eye Camera and Right Eye Camera with the "Target Eye" property set to Left and Right and the main camera on Main Display (I think).
    If you can't figure it out, getting the asset Selzier made would be a quick solution, I'm not sure how well it works though as I haven't tried it myself since it is another $20.
     
  7. jjennings1990

    jjennings1990

    Joined:
    Oct 25, 2012
    Posts:
    132
    Wow Thank you Masked Mouse , I am using 5.6 with Native integration so I'll roll my project back to an earlier version of unity and perhaps an earlier version of the GVR .
     
  8. MaskedMouse

    MaskedMouse

    Joined:
    Jul 8, 2014
    Posts:
    1,092
    if you want to benefit some of the features in 5.6 you could potentially use the non-native GVR 1.40 in Unity 5.6
    https://forum.unity3d.com/threads/u...nabling-and-disabling-vr.464499/#post-3064592

    I'm not sure if it works well as I haven't tried that yet either since we're just waiting for a fix of GVR overall since it is not working properly on iOS using a later version than Unity 5.6.0p1 (i.e 5.6.0p2, p3, p4, 5.6.1 are broken)
    GVR native is just a buggy mess to work with thats for sure.
     
    jjennings1990 likes this.
  9. jjennings1990

    jjennings1990

    Joined:
    Oct 25, 2012
    Posts:
    132
    Thank you again , I will try using the non-native version then !
     
  10. MaskedMouse

    MaskedMouse

    Joined:
    Jul 8, 2014
    Posts:
    1,092
    By re-reading your opening post, you're targetting daydream ain't that 5.6 and higher only?
    Not sure if that non native approach will work without the daydream sdk in the virtual reality supported but it is worth a shot I guess

    If ya cant get it done, don't waste too much time on it ;)
    Might want to consider to buy the asset
     
    jjennings1990 likes this.
  11. jjennings1990

    jjennings1990

    Joined:
    Oct 25, 2012
    Posts:
    132
    You may be right Masked Mouse and yes you are right I am targeting Daydream specifically. I'll take your advice and look at the Asset . I've spent far too much time trying to sort this out.