Forum Discussion

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

Render input from several cameras

Hi,

In short: I want to use an OVRPlayerController and in parallel an OVRCameraRig (clear flags depth only) to render two completely different perspectives into one resulting left eye right eye image set. The problem is that only the one with higher depth is rendered while the other one is black.

I already read that rendering different layers primarily makes sense when using close and far layers (for example https://forums.oculus.com/viewtopic.php?f=17&t=19089&hilit=camera+layers). Now I have a use case when it should make sense:

Imagine a room having a magic board in the middle (like a chess board). I show the room at layer Room using an OVRPlayerController. The board in the middle including some properties on it can be rotated using the gamepad's analog stick. The problem is that I need gravity to be enabled for this board. When I rotate the board all props on it are affected by the physics engine.

So I want to split up rendering into 2 cameras. One for the room which has a fixed position. The other one for the board is moveable and renders the board in layer Board. Doing so I can simulate the magic board's rotation by just moving the board camera rig around it. It looks smooth and the user don't feel confused as the room stays consistent with head movement.

On the other hand if I use just one camera moving around, the whole thing is pretty much prone to simulator sickness.

I used the OVRPlayerController for the room (depth -11 for RightEyeAnchor and -10 for LeftEyeAnchor). The OVRCameraRig for the board has depth values 0 and 1 and Depth Only as clear flags. This only shows the board but leaves everything else black when running on the device. In Unity editor it works as expected.

I use Mobile SDK 0.4.3 (had trouble to update to 0.5) and Samsung Gear VR Innovator Edition.

How can I accomplish this?

Thanks
Kay

1 Reply

Replies have been turned off for this discussion
  • Seems a bit like your reaching around the back of your head to scratch your nose :D
    I'm sure its just that I don't understand exactly what you are trying to do.

    To help answer your question: If you are rotating the camera around the game board and you want the objects to be affected by gravity physics as if you were rotating the game board, you will probably need to create your own gravity system that applies force in relation to the camera movement. Do this tutorial and by the end you might be able to figure out how to do what you want.. https://www.youtube.com/watch?v=gHeQ8Hr92P4

    Now I have to ask "why?"
    Why cant you just rotate the game board in the scene?