Search Unity

Culling mask problem with Google VR SDK cameras for stereoscopic 360 images

Discussion in 'Daydream' started by Curiscope_dev1, Jan 10, 2017.

  1. Curiscope_dev1

    Curiscope_dev1

    Joined:
    Jan 10, 2017
    Posts:
    3
    Hello guys, I am trying to set a different culling mask for each eye camera, within the rig generated when "Update Stereo Cameras" is called. In older versions of the SDK we got it working by setting the culling mask of each cameras from script or in the editor. This method doesn't work with the actual Google VR SDK and Unity 5.4 2f2-GVR13 Daydream Preview. It works as it should in play mode when testing with the editor but when the scene is built and running on an Android phone, the two eye cameras copy the culling mask set in the MainCamera and I could not find a way to avoid or override that.

    Just to give you guys a general view of what we're doing; our scene contains two inside-textured spheres, one for each eye, in different layers. Then we change the culling mask from each eye camera to cull one of the layers and show the other. In previous versions of Google VR SDK this worked perfectly.

    Does anyone else have this problem with culling mask on the eye cameras? Is there anyone else doing 360 stills but with a different method?
     
  2. joejo

    joejo

    Unity Technologies

    Joined:
    May 26, 2016
    Posts:
    958
    When you say Google VR SDK, do you mean the native integration or do you mean using the Google Unity SDK that Google provides?
     
  3. Curiscope_dev1

    Curiscope_dev1

    Joined:
    Jan 10, 2017
    Posts:
    3
    I mean the SDK for Unity, imported as an Unity package.
     
  4. joejo

    joejo

    Unity Technologies

    Joined:
    May 26, 2016
    Posts:
    958
    Can you try the 5.6b3 and see if this works there? There is a change to the way the eye textures are rendered that might resolve this.

    (although note that on 5.6 there is a bug where the ‘target eye’ property of the camera doesn’t work right now)
     
  5. thep3000

    thep3000

    Unity Technologies

    Joined:
    Aug 9, 2013
    Posts:
    400
    Note that "Update Stereo Cameras" is part of the Legacy scripts for pre native integration cardboard. You might be using an older rig?

    The way the native integration works, you typically have one camera. If you want to set culling masks per eye, you'll create two cameras, set the first camera to target eye 'left', second to target eye 'right', and set the culling masks appropriately.

    Make sure your target eyes are set correctly else one of your cameras will render over the other in both eyes.

    Also, 5.6 isn't going to work for you until the target eye bug is fixed there.
     
  6. Curiscope_dev1

    Curiscope_dev1

    Joined:
    Jan 10, 2017
    Posts:
    3
    Hi thep3000, I've tried a solution similar to what you're proposing but mine was a bit messy since I do not know how to prevent StereoController from creating additional cameras. What procedure do you reckon could be optimal to implement 2 cameras in such fashion? Could you please describe it with a bit more of detail please?
     
  7. thep3000

    thep3000

    Unity Technologies

    Joined:
    Aug 9, 2013
    Posts:
    400
    I'm not sure how exactly this would work with the google plugin. Maybe somebody else has done this and can chime in.
     
  8. edgnet

    edgnet

    Joined:
    Feb 11, 2017
    Posts:
    1
    Have you tried with the legacy GVRHEAD ?