Full screen mirroring is cool and all, but it’s not very useful if I want to show it in a window, or some split screen UI, or anything else.
So the way I have things set up now is to set showDeviceView to false, and created a camera with a render texture attached in order to do a split screen UI.
Unfortunately, when I use a profiler, I see that this gobbles up valuable CPU time. Attached is a screenshot of the profiler showing Camera.Render.Drawing using a pretty nasty mesh where the FPS is running at 10fps.
VRCloneCamera is the name of the camera I created with a render texture, and added as a child to the main VR camera. As you can see, it gobbles up an extra 26.97ms in addition to the regular VR cameras.
I also found that the FPS didn’t seem to be affected by turning showDeviceView on/off, and it doesn’t seem to appear anywhere in the profiler (that I could find). So I’m hoping to somehow find a way to take advantage of that.
Bump. Anyone?
This is becoming a more serious issue as I try to add screen space effects such as SSAO, then have to apply that on the clone camera as well, resulting in a double performance hit…
Still no joy?
I tried tackling this from a different approach - I got rid of the VRCloneCamera (which wastefully re-renders everything), and instead tried just hooking up an OnRenderImage script to the camera, and copy the source texture.
This is far faster, but unfortunately it doesn’t give me the same full screen coverage that showDeviceView uses. Which makes sense, since I’m only seeing what an eye see (either left or right, depending on when I capture every other frame in OnRenderImage).
I’m guessing there’s some sort of a center eye camera being used when you enable mirroring via showDeviceView. Either that, or some larger texture is being reconstructed from the left and right eye textures.
It’s looking like I’ll have to write a shader to merge the left and right texture to cover the full screen…?