Skip to main content
Participant
June 14, 2013

Different geometry rendered to each eye

Is it possible to have 2 pieces of geometry in Unity, and have each one only viewable from a single eye?
I do not have a rift to test, but am looking at ways to use one billboard for each eye, each with offset pre-rendered image that would represent a single 3D object when viewed through the rift.
    This topic has been closed for replies.

    31 replies

    Inspiring
    August 14, 2015
    Please use Unity 5.1.2p2 or higher and add a second Camera to the centerEyeAnchor GameObject. Then set the stereo eyes on the 2 cameras to Left and Right and set their culling flags so the textures only appear to one camera at a time. It's all in the editor GUI, no scripts. Hope that helps.
    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
    Up and Coming
    August 14, 2015
    Had to position the extra cam next to the centerEyeAnchor, when attached as a child, the rotation went pretty wrong. it's working fine now, Nice!

    Thanks!

    So if i understand correctly i'm throwing away some performance in doing it that way. Is the stuff below possible and would it have an beneficial effect on performance?

    • Have a central camera set to Target Eye: Both, have it render everything except for left and right culling masks.

    • Have a left camera for left, set culling mask to ONLY render left

    • Have a right camera for right, set culling mask to ONLY render right

    play with the depth of the cameras so the central one would render everything needed and then layer the left and right on top of that.

    I've tried the above, but can either only get everything to render (except the stereo layers) or only the left right cameras, according to the depth i put the cameras in. is there any trick to "merge" the 2 layers? or am i going totally off board with this and would it not really help performance anyway?

    Again thanks for the support!
    New Participant
    August 18, 2015
    "cybereality" wrote:
    Please use Unity 5.1.2p2 or higher and add a second Camera to the centerEyeAnchor GameObject. Then set the stereo eyes on the 2 cameras to Left and Right and set their culling flags so the textures only appear to one camera at a time. It's all in the editor GUI, no scripts. Hope that helps.


    Hi, I'm using 5.1.2 with the Oculus Utilities for Unity 5 V0.1.0-beta
    But I found there's no way to use separate cameras for different eyes.

    In Unity's document: http://docs.unity3d.com/Manual/VROverview.html
    They state:
    Automatic stereo display
    It is not required to have two Cameras for stereoscopic displays. Any camera that has no render texture is automatically rendered in stereo to your device. View and projection matrices are adjusted to account for field of view and head tracking.
    Optimizations automatically occur to make it less expensive to draw frames twice (once for each eye).


    Is that means I have to use the mobile SDK 0.6 for the rendering two different textures each eye trick?
    Up and Coming
    August 19, 2015
    as stated in the posts above you can add a second camera and set it's rendering to only left eye, and the original one you can set to render only the right for example, it is perfectly possible with 5.1.2p3 as i'm doing right now.
    New Participant
    August 19, 2015
    "TomG" wrote:
    as stated in the posts above you can add a second camera and set it's rendering to only left eye, and the original one you can set to render only the right for example, it is perfectly possible with 5.1.2p3 as i'm doing right now.


    How do you make a camera only render one eye?
    What version of SDK you're using?
    New Participant
    August 25, 2015
    Bump,

    How do you make a camera only render one eye?

    Is it possible with Unity 5.1.3f1 and Oculus Utilities for Unity 5 V0.1.0-beta ?
    Inspiring
    August 25, 2015
    Yes, you can do it in Unity 5 with the Oculus Utilities. Here are the steps:

    - Import Oculus Utilities into your project (I'd start with a new project just for testing).
    - Comment out the foreach block (around line 179 - 189) in OVRCameraRig.cs.
    - Inside the Heirarchy, duplicate CenterEyeAnchor and name it CenterEyeAnchorLeft. Leave the original one alone.
    - Go in the CameraEyeAnchorLeft and set "Target Eye" to "left". Make the original "right"
    - Create two new layers "Camera Left" and "Camera Right".
    - Go in the culling mask for the camera component on CenterEyeAnchorLeft and deselect the "Camera Right" layer. Do the same for the original CenterEye (but with "Camera Left").
    - Make sure any stereo geometry is set to the proper layer. Meaning objects only visible in the left eye should have the layer of "Left Camera" or similar for the right.

    This will allow things like stereo textures, or displaying completely different objects in each eye.

    Hope that helps.
    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
    Up and Coming
    September 10, 2015
    - Go in the CameraEyeAnchorLeft and set "Target Eye" to "left". Make the original "right"


    Hi,
    i'm trying follow your steps - but i can't find any setting or component in the CenterEyeAnchor or anywhere else which says "Target Eye" - what am i doing wrong ? Or do i get it wrong ?

    I'm using DK 1, Unity 5.2 and Utilities for U5 v0.1.0-beta - and start with the cubes scene. On none of these game objects i can find that "Target Eye" setting:
    - LeftEyeAnchor
    - CenterEyeAnchor
    - RightEyeAnchor
    greetings from bavaria
    Inspiring
    September 10, 2015
    To do this you need to be using 5.1.3p2.
    Up and Coming
    September 10, 2015
    Ok, thanks! Now there is a Target Eye setting available :-)
    But it seems to be removed again with the 5.2 release ... is this method a dead horse i'm betting ?
    greetings from bavaria