How to combine/composite cameras in a VR scene?
I am working on a scene that renders selected parts of the scene in high detail via viewport clipping. I am doing this using 2 cameras. One camera renders the full scene in low detail and another renders the center of the viewport in high detail. The 2 RenderTextures of the cameras are finally combined using a 'combine depth' shader.

I am using the Oculus DK2, Unity 5.2.3f1 and the Oculus Utils v.0.1.3.0. Render path is 'forward' and using non-HDR cameras.
Currently I am doing all the above by placing a custom Image Effect on the 'CenterEyeAnchor' camera. I have grown unsure whether this is the correct approach as I need to take a few odd steps to make this work. I e.g. need to double the height of the involved RenderTexures:
line 32 of CombineDepth.cs
My intuition tells me that I need to do this camera compositing for both the left and right camera and then let the OVR package combine that. That would require some manual modifications to the OVR package scripts. Before I dive into that, I'd like to hear if anybody else has experience with this?
So my questions are:
The project can be downloaded from here

I am using the Oculus DK2, Unity 5.2.3f1 and the Oculus Utils v.0.1.3.0. Render path is 'forward' and using non-HDR cameras.
Currently I am doing all the above by placing a custom Image Effect on the 'CenterEyeAnchor' camera. I have grown unsure whether this is the correct approach as I need to take a few odd steps to make this work. I e.g. need to double the height of the involved RenderTexures:
line 32 of CombineDepth.cs
//TODO: Why do we have to multiply height by 2? Due to stereoscopic display?
_FarRT = new RenderTexture(Screen.width, Screen.height * 2, 16,
RenderTextureFormat.ARGB32);
_NearRT = new RenderTexture(Screen.width, Screen.height * 2, 16,
RenderTextureFormat.ARGB32);
My intuition tells me that I need to do this camera compositing for both the left and right camera and then let the OVR package combine that. That would require some manual modifications to the OVR package scripts. Before I dive into that, I'd like to hear if anybody else has experience with this?
So my questions are:
- What is the correct procedure for doing camera compositing/combining when doing VR in Unity using the OVR package from Oculus?
- Is it possible to do camera compositing/combining in VR using the 'integrated VR support' in Unity
The project can be downloaded from here
