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

    Up and Coming
    June 14, 2013
    Dang that's an interesting idea Fiore. I'm not sure though, it sounds somewhat 'headachy' to me, but perhaps I just don't grasp the concept in it's entirety.
    I'm curious to know how it works out!
    “If you are willing to look at another person’s behavior toward you as a reflection of the state of their relationship with themselves rather than a statement about your value as a person, then you will, over a period of time cease to react at all.” (~I really gotta remember this shiz~) ― Yogi Bhajan
    Up and Coming
    June 14, 2013
    Easy to do, just put a call in OnPreRender on each eye that sets a global shader constant for the eye number, and use it as a branch condition or texture offset. Check the docs for the shader class.
    Up and Coming
    June 14, 2013
    Another solution:

    - Create two new layers named "left eye" and "right eye"
    - Adjust what layers each camera has visibility to (left camera cant see right eye, etc.)
    - Assign the special billboarded textures to each eye
    Inspiring
    June 14, 2013
    I had the idea of stereoscopic billboards for a while now, but I haven't seen them used yet.

    Would be awesome if you got this working.
    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
    sh0v0r
    Up and Coming
    June 14, 2013
    "scsioverdrive" wrote:
    Another solution:

    - Create two new layers named "left eye" and "right eye"
    - Adjust what layers each camera has visibility to (left camera cant see right eye, etc.)
    - Assign the special billboarded textures to each eye


    Yeah this is the simplest way to control what a camera renders.
    Participant
    June 30, 2015
    I tried to "OnPreRender" approach without success.

    I am using Unity 5.1.1f1 with a pre 0.6.0.1 SDK (the one just before, can't remember the number). I'm not using the latest SDK because I can't get it to display the dual view inside the Unity editor.

    Anyway, I'm seeing that the onPreRender callbacks are called, but they have no effect on the rendering.
    I have set it up so that the geometry is rendered in red on left eye and blue on right eye (using a material shader parameter).
    Anyway, what I am seeing in the GearVR is that both cameras render the scene in blue (meaning that only the shader settings from the right eye are taken into account). Since right eye is rendered after left eye, I'm guessing my callback is overwriting the shader's value, so both eyes get the same value.

    Has anyone been successful with this approach?
    I'm considering trying this out with sdk 0.6.0.1, but the fact that I can't get OVR initialized in the editor and get no dual view is a real pain...
    Participant
    June 30, 2015
    Ok I did run a test with SDK 0.6.0.1 / Unity 5.1.1 and it works :)
    New Participant
    August 11, 2015
    How did you access to the sdk directly from unity???
    Inspiring
    August 11, 2015
    You can't use the SDK directly in Unity. You'd use the integration or (preferably) the utilities.
    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
    "judiva" wrote:
    Ok I did run a test with SDK 0.6.0.1 / Unity 5.1.1 and it works :)


    Could you share some example code on how to accomplish this? i went ahead and added a new camera on to each eye anchor and removed some code in OVRCameraRig so they would not get disabled in the 6.0.1 tools.

    This works and stereoscopic bilboards are great to look at, but i would like to avoid the 2 extra cameras.
    Also for some reason, movement seems a bit wonky, where the default OVRPlayerController would not walk perfectly in the direction you're looking. when i disable my 2 new cams and just enable the center one, the movement is as expected.

    a movieMaterial where the offset can be controlled acording to the eye that is rendering at that time would be great. I'm just starting unity (coming from the flash world) but if you want to go Oculus.... (and have a comunity that is still arround :-) ) go Unity :-)

    Thanks in advance for any more detailed pointers on how to accomplish this.