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

3d Vision + ortho stereoscopy

Discussion in 'AR/VR (XR) Discussion' started by pet_Cz, Mar 6, 2019.

  1. pet_Cz

    pet_Cz

    Joined:
    Jan 17, 2014
    Posts:
    9
    Hello. I am working in stereoscopy many years and I've decided to move from custom engines to Unity. I've read many topics on Unity and Nvidia 3d vision and from some of them it seemed to be a big problem. But I've tried and here are my successes and fails. My first (and I hope right) attempt was turning on the VR support and use Stereo Display (non head-mounted). As I need as much control over my cameras position, I've created two cameras (one with red background and the second one with blue) and set one camera's target eye to left and second to right. While playing the game directly in Unity, there is no stereo. But who cares, once everything is set up correctly, this is a minor problem. After building and running the project, I can see red color in one eye and blue in the other. Hooray! Now it is a time to set up cameras. It seems to be even easier than I thought. Using Physical camera checkbox, I've set the sensor size to exactly the same size as my display. Focal length now corresponds to the distance of the viewer from the screen. I've moved one camera by half IPD left and the other right and used Lens shift to skew the frustum. In unity editor, both camera seems to cross exactly on the screen plane. In the game window, objects on the screen plane have zero parallax. Time to go stereo.

    Surprisingly it is not working. There is quite a large parallax for screen plane objects. Going back to Unity and trying to find out what's wrong. I've set the Stereo convergence to 0 and run another test. There is nothing on the screen, so the parameters are somehow involved. I do not want my camera to converge at all as I am using my own frustum modification. So I've set the convergence to really high number (as I understand, the number is the distance where the camera pair crosses). The other parameter is Stereo separation. I am doing my own separation, so I've set it to 0. The parallax is even bigger (but the perspective from L/R eye seems to be correct). The other try was to change the parameter to negative value to compensate my own separation. But the result is that there is no separation at all (even for distant objects) and both eyes are the same.

    Please, could someone explain me, what's going on there? Is there a simple way to use the cameras as is without any modification via Stereo Separation and Convergence parameter? Or is there the Nvidia driver involved?

    Thank you
     
    EyePD likes this.
  2. pet_Cz

    pet_Cz

    Joined:
    Jan 17, 2014
    Posts:
    9
    I am adding some images, to show what I mean.

    Setup in editor (the green line in the middle is a visualisation of a virtual screen). The front side of the middle cube is positioned exactly on the screen, thus it should have a zero parallax:


    Testing the output of left and right camera in unity (combined to a single image in PS, without any translation). The middle cube has zero parallax (to be able to visualise the situation, "anaglyph filter" in front of each camera is added):


    Finally a photo of screen (I did not succeeded to take a computer print screen of both eyes) while running a build in stereo mode. The parallax is huge:
     
    Last edited: Mar 7, 2019
  3. pet_Cz

    pet_Cz

    Joined:
    Jan 17, 2014
    Posts:
    9
    Please some tip or explanation of this behaviour? I still did not succeeded to solve it.