I'm trying to view (Top Bottom) stereoscopic video using a photosphere and the culling mask technique for GoogleVR (Daydream), but it doesn't seem to be working as intended. Here's what I've done:
Basically my scene has 2 cameras and 2 photospheres in exact same positions. I'm using the Culling Mask element of the left Camera to block the right Sphere and vice versa for the right Camera, so the left eye only sees the left sphere and the right eye, only the right sphere. The "LeftSphere" is playing the top half of the video and the "RightSphere" is playing the bottom half. Therefore, I should be seeing stereoscopic.
Also, since my scene is VR enabled, there is a "Target Eye" element on both cameras. I set that accordingly - Left for left camera and Right for right camera.
The problem is when I play my scene in Unity to test it, it's playing only the RightSphere on both eyes and the left sphere is not being seen by any camera.
Here's what I found out is going on. I just don't know how to fix it:
(I'm using UMP - UniversalMediaPlayer unity asset for video, btw)
I've tried it on my daydream viewer with my Pixel and it is indeed only playing monoscopic.
Alright, so I finally got it working! In case anyone is running into the same issue in the future, here's what you need to do:
I'm using Unity 2017.1.0b4 and UniversalMediaPlayer for my video player. Note that this is only for GoogleVR.
This is where it was causing me issues. Because new cameras are created every time you load or play your app, I had to find a way to change the "Culling Mask" and the "Target Eye" for these 4 cameras. The only way I found how to do that was through a script.
GameObject left;
Camera leftEye;
GameObject right;
Camera rightEye;
public LayerMask LeftEyeMask;
public LayerMask RightEyeMask;
// Use this for initialization
void Start () {
left = GameObject.Find(gameObject.name + " Left");
if (left != null) leftEye = left.GetComponent<Camera>();
right = GameObject.Find(gameObject.name + " Right");
if (right != null) rightEye = right.GetComponent<Camera>();
}
// Update is called once per frame
void Update () {
// LEFT EYE
if (left == null)
{
left = GameObject.Find(gameObject.name + " Left");
if (left != null)
leftEye = left.GetComponent<Camera>();
}
else
{
leftEye = left.GetComponent<Camera>();
if (leftEye != null)
{
leftEye.stereoTargetEye = StereoTargetEyeMask.Left;
leftEye.cullingMask = LeftEyeMask.value;
}
}
// RIGHT EYE
if (right == null)
{
right = GameObject.Find(gameObject.name + " Right");
if (right != null)
rightEye = right.GetComponent<Camera>();
}
else
{
rightEye = right.GetComponent<Camera>();
if (rightEye != null)
{
rightEye.stereoTargetEye = StereoTargetEyeMask.Right;
rightEye.cullingMask = RightEyeMask;
}
}
}
Your Top-Bottom video should now be playing in 3D in Daydream or Cardboard.