Forum Discussion
teamfuture
12 years agoExplorer
Custom camera rects?
I'm working on a project right now (Black Hat Oculus). It's a two-player game where we render one thing (an overhead map) to the monitor, and a different thing (a 3D world) to the Rift player. I've been doing this as a long window that spans both screens, with one camera rendering on the left and the Rift cameras rendering on the right, and that's worked fine...on the DK1.
I'm trying to upgrade my project for the DK2 (SDK .0.4.2). It appears that cameras render to render textures, which are then rendered to the screen via the plugin, so that process is (as far as I know) black boxed to me.
So is there any way I can specify the screen rect that the plugin renders to? Or are there any workarounds I could do?
I'm trying to upgrade my project for the DK2 (SDK .0.4.2). It appears that cameras render to render textures, which are then rendered to the screen via the plugin, so that process is (as far as I know) black boxed to me.
So is there any way I can specify the screen rect that the plugin renders to? Or are there any workarounds I could do?
9 Replies
Replies have been turned off for this discussion
- ryahataHonored GuestHave you taken a look at my post? https://developer.oculusvr.com/forums/viewtopic.php?t=11707
In short, this feature is not supported by Oculus. The quickest way to get it is to network sync your game and run another unity instance. So the server would be the Rift and the other windows would be clients. Not really ideal but it shouldn't be too hard to implement. - ChromegaMemberThanks, that thread was very helpful. I really hope that support for this gets added back, I'm really interested in asymmetric multiplayer games played with a user on a monitor and a user on the Rift.
For my case, I can live without position tracking for now, I just need to quickly get out a version of my game that will work with DK1 and DK2, so I'll see if 0.3.2 works for me.
If they don't end up supporting this, I'll probably have to go the networked-but-not-really-networked architecture, which wouldn't be ideal but at least it's an option...
EDIT: Whoops, and yeah, I'm the original poster, the first was my team account this is my personal account. - ryahataHonored GuestSounds like you are creating a multi player game. I know it's more convenient for users to play off one computer but you might want to consider using two. How complex are your scenes? The DK2 works best when it is getting 75 FPS. I had the optimize the snot out of a few of my scenes to get 75 FPS and I can only imagine that rendering a first person cam for another player is going to add another layer of complexity. Just something to consider.
- teamfutureExplorerYeah our scenes aren't visually complex so performance hasn't been an issue on the machines we've been using to test. We'd really like to keep this as a local game, for a variety of reasons:
-It's fun to be able to play with someone who wants to try out your Rift at your house (common scenario for me)
-Our game relies a lot on communication
-We don't really have a budget, so we're not really eager to run matchmaking servers
-Networking is a little out of scope (we actually had a networked version working, but there's a lot of UI to be built, and we've had issues with people on their home routers behind NAT hosting games)
I've also been exploring other options, like having a "networked" game that just runs on a user's local machine (two applications talking to one another), but I've had issues getting the windowing working the way I'd like (especially on OSX...we want to both support Windows and OSX).
Thanks for the tip! - ryahataHonored GuestSorry if my response wasn't clear but when I said networking in my first response, I meant for a locally hosted network game. The only reason why I brought up using two computers is the rendering overhead. Like I said in one of my previous posts, the DK2 works the best when it gets 75 FPS. Running two Unity players on the same PC might not be possible if your scene is extremely complex.
Also another thing to note is capturing input might be a little tricky since usually only one window can take the foreground. - teamfutureExplorerYeah input handling would be a little tricky. I'd probably have to have one window process all of the input (probably the oculus player), but then the other player would have some latency in everything they did. So on Windows, I know I can selectively maximize instances of Unity on certain monitors with the -adapter N command line argument, but I'm not sure how to do this on Mac. If there's a reliable way to do that, I might reconsider my approach. Our scenes are not visually complex (especially for one player, we have camera masking all over the place).
Also, here's an example of what I'm trying to do:
For now, I've been taking the 0.3.2 route. There are some annoyances that I'm trying to work through - most notably, the DK2 rendering is flat out wrong on OSX. Each eye is only rendering to a small portion of its camera rect (maybe at DK1 resolution or something?). It's mostly working fine on Windows, except that the game crashes on quit if the camera sees the DK2 when you click close.
I'm probably going to keep trucking along with 0.3.2 for now, and keep my fingers crossed that this gets re-supported in a future SDK. I can live with 60fps non-timewarp rendering for this project. - ryahataHonored GuestFirst off, that's a neat little game you got there. I dig it :)
Secondly, I admire your willingness to support multiple platforms (I'm actually much more of a Mac guy but I dev mostly on Windows and Linux) but you might want to concentrate on setting up the core framework of your game for now and when the SDK becomes more solid add in Mac support. I've never tried doing any development for the DK2 on Mac but I heard there are some leaps and hurtles to overcome.
Lastly, I agree with making the Rift the "main" app is probably the way to go. Since things are run locally on one machine I assume the latency won't be too bad... It would be interesting to do a little test to see what the latency actually is.
Good luck with your game! - szDevHBGerHonored GuestHi ryahata,
hi teamfuture,
did you got any solution for the problem?
We have exactly the same, on DK1 the rects could be set and with DK2 not any more ;-(
In the attachment you can see our screen organisation.
We have noticed it's the same you posted in the Youtube Video :-)
Hope to hear of you,
maybe we find a solution in network ;-)
Regards,
Matthias - ryahataHonored GuestszDevHBGer,
It looks like using some sort of networking would be the best solution. I would make the student the main application and use networkviews and RPCs to implement the teacher application.
Hope this helps.
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 months ago
- 2 months ago
- 3 years ago