Forum Discussion
PixelRouter
10 years agoExplorer
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.
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.
2 Replies
Replies have been turned off for this discussion
- cyberealityGrand ChampionYou 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).
- vrdavebOculus StaffIf 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
Quick Links
- Horizon Developer Support
- Quest User Forums
- Troubleshooting Forum for problems with a game or app
- Quest Support for problems with your device
Other Meta Support
Related Content
- 8 months ago
- 2 years ago