Forum Discussion

🚨 This forum is archived and read-only. To submit a forum post, please visit our new Developer Forum. 🚨
rjmig88's avatar
rjmig88
Honored Guest
11 years ago

[deleted]

[deleted]

4 Replies

Replies have been turned off for this discussion
  • 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.