Search Unity

Google Daydream - Render different content to each eye

Discussion in 'Daydream' started by pcaston2, Jan 20, 2018.

  1. pcaston2

    pcaston2

    Joined:
    Mar 11, 2014
    Posts:
    1
    I have a scene with 2 spheres, and I would like to get it to show the left sphere in the left eye, and the right sphere in the right eye. When I tried to change the demo project, it appears that the "MainCamera" tag is used, and that the camera is then split into left and right, and it appears the culling masks can't be changed individually.

    Ideally I'd like to set the layer to 'left' or 'right' on an object and have it display in the corresponding eye.

    Is there a way to achieve this?

    I suffer from amblyopia (lazy eye) and am hoping to create an app that will help correct my vision.

    Thanks so much!

    stereo.png
     
  2. dsternfeld

    dsternfeld

    Official Google Employee

    Joined:
    Jan 3, 2017
    Posts:
    72
    You can set the stereoTargetEye in the camera's inspector to control if a camera renders into the left eye, the right eye, or both. https://docs.unity3d.com/ScriptReference/Camera-stereoTargetEye.html.

    Create two cameras and keep them at the same position, set one to render the left eye and one to render the right eye. Then, you can use the cullingMask to control which sphere is rendered for each camera.

    Thanks,

    Dan