- Home /
Multiple Game Cameras with the Oculus Rift
Hey folks,
Here's what I want to do: A game I'm working on is an asymmetric two player game, where one player is in the Rift (w/controller), and one player uses a normal monitor (w/mouse & keyboard). I've been doing this networked on 2 machines, but for a variety of reasons, I want to make a version where both players can play on one machine.
I've done some researching and I've been able to get this working on my machine. I have 3 cameras with appropriate viewport rects, I have the game running with the -popupwindow flag to remove borders, and I'm setting the screen's resolution to the appropriate resolution.
However, I want something more robust. I'm making a lot of assumptions in my prototype scene. I'm assuming that:
- I'm running Windows (-popupwindow is marked as working on Windows only)
- I know the resolution of my main monitor and my Rift and their layout ahead of time
- The game window will always position itself in the right place
Anyone have any tips as to how I can make this more robust? Are there (preferable graphics card/OS invariant) ways I can get individual display information? I've played around with the Display class, but it's not quite what I want (it reads my 2 normal monitors as one really wide display, when I really want the information on the displays separately). Any way to get behavior like -popupwindow on Mac? I've found ways to move the Unity window on Windows (http://forum.unity3d.com/threads/84252-Window-manipulation-in-unity), but I have no idea how to do so on Mac.
I know there are a lot of questions here, but I'm hoping that there are others who have attempted this that may have answers. I think these types of games are very exciting, I would just love to make something I can easily share, and not require users to manually enter in their display configuration in some batch file/pre-game screen, for instance.
Thanks.
Hi Chromega! Very good questions. I'd be happy to even get this work at the level you say you do in your post. Any chance you'd be able to share how you did this? I'm using unity in my graduate thesis for play based procedural mesh generation and I'm going to need several displays. $$anonymous$$eep up the good work!
How were you able to prevent the oculus cameras from hijacking the entire window, regardless of the viewport rect settings? In my OVRCameraRig, I've set my viewports for both left and right eyes to be X=0.5, Y=0, W=0.5, H=1.
I'd expect that camera to be using 50% of the window, split between the two views required for stereoscopic vision. Ins$$anonymous$$d, it will always span the entire window.
Answer by MikeNewall · May 19, 2014 at 02:45 AM
There is a mono dll (System.windows.forms.dll) if you add it to a plugins folder in unity you should be able to get info about the primary screen using Screen.primaryScreen or Screen.Allscreens to access all of them.
The dll is located here: C:\Program Files (x86)\Unity\Editor\Data\MonoBleedingEdge\lib\mono\gac\System.Windows.Forms
Your answer
Follow this Question
Related Questions
How do I output to Oculus Rift on Unity 4.6? 1 Answer
My multi-monitor support is broken. How can I fix this? 2 Answers
oculus, gui and menu not showed correctly 0 Answers
Oculus "PerEyeCameras" showing blackscreen only when LWRP or URP is enabled 0 Answers
Can one camera be the background layer for 2 others? 0 Answers