Skip to main content
Up and Coming
September 12, 2015

How Do We Layer Cameras using Utilites For Unity?

I'm finally able to do this properly using Unity's integrated VR support, but can't figure out how to do it using the prefabs that come with the Utilities for Unity.

Using the native VR implementation, its a simple matter of attaching a second camera to whatever node your first camera is attached to and then setting the second camera to Depth:1 and Clear:DepthOnly. This just works and its really nice to be able to effect my cockpit differently than the outside world.

This is what my working setup looks like :



What is the right way to do this using the more feature rich prefabs that come with Oculus Utilities for Unity?

I can't figure out where to put a second camera.
    This topic has been closed for replies.

    2 replies

    Inspiring
    September 12, 2015
    You can duplicate CenterEyeAnchor (which has the camera on it) and I think it should work. However you may have to comment out some lines in OVRCameraRig.cs (you'll see the error in the console if it disables your new camera).
    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
    Inspiring
    September 12, 2015
    If you don't want to make a script change, the way we test this is by creating two OVRCameraRigs and setting the depth, clear flags, clip planes, and culling masks on the CenterEyeAnchors of each as follows:

    Far Rig:
    - Depth = 0
    - Clear flags = skybox (or solid color)
    - Culling mask = world
    - Near clip plane: 10
    - Far clip plane: 10000

    Near rig:
    - Depth = 1
    - Clear flags = depth only
    - Culling mask = cockpit
    - Near clip plane: 0.01
    - Far clip plane: 10