Skip to main content
Participant
January 17, 2016

Stereo camera

I wanted to render stereo vision into oculus rift. I've been researching a lot on this topic, and found openCV with openGL or direct3D will do the job. But can unity alone be suffice to do this job?

    7 replies

    Inspiring
    January 17, 2016
    Are you talking about in-game rendered stereo or physical stereo cameras mounted on the headset?

    If you are just talking about in-game stereo, then of course this works with Unity (and Unreal).
    AMD Ryzen 7 1800X | MSI X370 Titanium | G.Skill 16GB DDR4 3200 | EVGA SuperNOVA 1000 | Corsair Hydro H110i Gigabyte RX Vega 64 x2 | Samsung 960 Evo M.2 500GB | Seagate FireCuda SSHD 2TB | Phanteks ENTHOO EVOLV
    saimouliAuthor
    Participant
    January 17, 2016
    Real life stereo. (Also I'm referring to openGL with GLUT toolkit)
    Inspiring
    January 17, 2016
    I haven't tried it myself, but it seems very possible to me.
    AMD Ryzen 7 1800X | MSI X370 Titanium | G.Skill 16GB DDR4 3200 | EVGA SuperNOVA 1000 | Corsair Hydro H110i Gigabyte RX Vega 64 x2 | Samsung 960 Evo M.2 500GB | Seagate FireCuda SSHD 2TB | Phanteks ENTHOO EVOLV
    Inspiring
    January 17, 2016
    Unity apparently supports a WebCamTexture that lets you feed data from a camera into the scene. However, in order to do this effectively you need precise knowledge of the latency of the camera.

    A naive approach would be to just take the webcam texture and place it in the scene at a fixed position relative to the Unity camera. However this doesn't produce very good results because in the delay between when the image was captured by the webcam and the time when it's rendered in the scene, your head may have moved.

    But, if you track the head pose for when images are captured, then you can compensate for the change in head pose by the time they're displayed. Like this:
    Brad Davis - Developer for High Fidelity Co-author of Oculus Rift in Action
    Up and Coming
    January 22, 2016
    And here is naive approach as explained by jherico (simpler to implement but the latency of the 3D camera might be uncomfortable (the ZED camera seems to provide 120fps with VGA resolution)): https://github.com/stereolabs/zed-oculus
    It depends of what you would like.
    saimouliAuthor
    Participant
    February 2, 2016
    Thanks both. I'll be rendering videos from two GoPros 4 black @90 FPS and 1080p resolution. Since GoPro has fisheye distortion lenses can we simply use openCV to render videos on to HMD? I understand the latency part. If we have a good transmitter we can cut down the latency. Again if latency wasn't an issue can this be done?
    Inspiring
    February 3, 2016
    "saimouli" wrote:
    Since GoPro has fisheye distortion lenses can we simply use openCV to render videos on to HMD?


    You cannot use OpenCV alone to render to the rift, if yoiu have the rift runtime installed. You can only render to it using an oepngl or Direct3D texture via the SDK. If your doing have the runtime or drivers. Installed, then its just another monitor.


    Regardless,just because your camera has a fisheye lens doesn't mean it would look correct in the rift unless the lens distortion happens to be the exact inverse of the Rift lens distortion, which is extremely unlikely.
    Brad Davis - Developer for High Fidelity Co-author of Oculus Rift in Action