Skip to main content
Up and Coming
April 30, 2015

[deleted]

[deleted]
    This topic has been closed for replies.

    4 replies

    rjmig88Author
    Up and Coming
    April 30, 2015
    Also I tried OnPreRender, OnPreCull, and other variants I could think of. Other thread I started on the Unity forums: http://forum.unity3d.com/threads/blitti ... er.321683/
    Founder of Incendiary Games: http://www.incendiarygames.com/ Mobile VR Jam: http://vrjam.challengepost.com/submissi ... king-title Mobile VR Jam Form Post: viewtopic.php?f=77&t=22887
    rjmig88Author
    Up and Coming
    May 3, 2015
    Anyone have any ideas?
    Founder of Incendiary Games: http://www.incendiarygames.com/ Mobile VR Jam: http://vrjam.challengepost.com/submissi ... king-title Mobile VR Jam Form Post: viewtopic.php?f=77&t=22887
    New Participant
    May 4, 2015
    I'm currently in the exact same position as you - my solution is so far very similar to yours as well (Set up a 'monoCam', render that view into a RenderTexture, then blit / copy into the OVRdisplay's left and right eye textures).

    I'm able to get it to work so far as rendering the scene entirely monoscopically by setting the OVR cameras to only render a 'stereo' layer - but never put anything in it. Then in OnPostRender of my monoscopic camera I blit its rendertexture into the left and right cameras.

    This has the benefit of only rendering scene geometry once (just watching the profiler, I can see that the number of tris rendered is about half), but I am at a standstill as far as getting a blend of Monoscopic and Stereoscopic objects due to not being able to get the depth information into the OVRdisplay's eye textures - and as you said, I have some UI elements that are actually Monoscopic getting rendered on top of (closer to the camera than) some Stereo objects.

    Unity's documentation (http://docs.unity3d.com/ScriptReference ... .Blit.html) states that in order to preserve the depth information one has to do a 'manual blit', however either their description is wrong, or it just doesn't work with Oculus' Unity Integration. When I call this before rendering the full screen quad:
    Graphics.SetRenderTarget(eyeTargets[eyeTexIx].colorBuffer, monoTexture.depthBuffer);

    I'm not sure how this is supposed to 'copy' the depth buffer from monoTexture into eyeTargets since the material that renders the full screen quad into eyeTargets has ZWrite disabled.

    I've been thinking that in order to make this work, I might have to go down the route of writing a special shader and calling .Render() manually on the OVR cameras, but I haven't gone that far yet. Wondering if you've had any luck.
    rjmig88Author
    Up and Coming
    May 4, 2015
    [deleted]
    Founder of Incendiary Games: http://www.incendiarygames.com/ Mobile VR Jam: http://vrjam.challengepost.com/submissi ... king-title Mobile VR Jam Form Post: viewtopic.php?f=77&t=22887