Skip to main content
Up and Coming
July 30, 2014

Set up for working with DK2 in Unity

Hi all, how are you setting up your system for developing in Unity with DK2?

I love the idea of direct access, a great step forward, but until (if ever?) that works in the unity editor, the DK2 seems even more awkward to me than the DK1 was... unless I'm doing something wrong.

If I duplicate the displays, I get a maximum resolution of 1080x948, which is too small to work with - I don't understand why that's not 1920x1080, and it'd be much more useful if it was - any ideas?

If I extend displays with my main monitor as the 'primary', everything works ok, but the display in the rift is very significantly slower and more juddery.

If I extend displays with the rift as 'primary', the display in the rift is nippy, but then windows becomes practically unusable, with all the menus, icons and any new apps appearing in the rift and needing to be moved with lots of awkward one-eyed peering.

Any advice on optimizing the setup much appreciated - how do the Oculus guys have it configured? I think the main reason it seems more awkward than before is because I used to duplicate, and get a decent resolution (I think?!). Having seen how well it works, I now *really* want direct access mode to work in Unity. I guess at the moment I have to choose between slow rift, awkward windows, or really low resolution.

(BTW: I'm running Windows 8.1)

Thanks,

Dave
    This topic has been closed for replies.

    33 replies

    Inspiring
    July 30, 2014
    "fredrum" wrote:
    Because at certain times I load up my unity scene and things look blurry like in the old days and at other times the movement look crisp as with the low persistence.

    We currently disable low persistence in the editor because it always renders at the refresh rate of the primary display. However, low persistence is enabled in standalone players. In some cases, it does seem to get stuck in the "off" state. You can force it on with OVRDevice.SetLowPersistenceMode(true). In Tuscany (or any app using OVRMainMenu), the F1 key will toggle it.
    Up and Coming
    July 30, 2014
    Ok cool thanks for the advice. I'm currently always testing a built .exe.
    But great then I can try adding a hot key to force it and if that changes the view then I know a bit more.
    Up and Coming
    July 30, 2014
    "vrdaveb" wrote:
    You can force it on with OVRDevice.SetLowPersistenceMode(true)


    I just added this to my demo and I don't know. It does something but to my eye the low persistence is still happening as edges and small details do not seem more blurred.
    What does happen is that everything goes a bit wobbly, like a lag on the rotational camera tracking.
    And when I show the space bar info it says that Prediction has been turned Off.
    I hit my hotkey to OVRDevice.SetLowPersistenceMode(true) and Prediction is now back (0.03) and no more camera lag. But still no sense of actual persistence blur being different.

    Sorry if you are busy this is not a priority for me personally maybe, but would be cool to get figured out at some point.
    Up and Coming
    July 30, 2014
    There are scripts floating around like this http://pastebin.com/g7UnXydZ that will let you precisely align the window to the Rift display, with no border and at the exact right aspect ratio, but you have to put in the numbers manually.

    It would be nice if the Oculus SDK could do this automatically when you hit play by querying the runtime for window coordinates.
    Up and Coming
    July 31, 2014
    Sorry to duplicate my post in another thread, but it's relevant here - this is the only method I've found that works so far:

    I've now worked out a somewhat cumbersome method that does basically work, and will do for now. IMO the solution is for Unity to implement direct access mode for the game view, but I guess this will work while I wait:

  • You'll want your start bar extended across multiple monitors - annoyingly if you haven't already done this before you updated to windows 8.1, there's a bug that hides that option(!) - workaround(s) in this thread:
    http://social.technet.microsoft.com/Forums/windows/en-US/a1dc4fa9-e3fd-4e1e-a174-5acde06a43e0/multiple-display-options-for-taskbar-missing-after-windows-81-update?forum=w8itprogeneral

  • Set rift to extended desktop mode (making sure it's 1920x1080x75hz, and I had to choose 'landscape (flipped)' on the rift)
  • Set rift as primary monitor (sometimes a right pain, because you get 15 seconds to click 'keep' and that dialog is likely to be displayed in the rift! Luckily you probably only need to do this once - peer through the rift and try try try)
  • Now you can switch the rift off, and your main monitor will become the primary, for working in Unity.
  • There's almost nothing you can usefully do with the game view in unity, apart from work on menus etc. I guess unless you've duplicated your head tracking to mouse or something. I suppose with it torn out (as suggested in the guide) you *could* try out basic things as long as you don't mind getting sick!
  • When you want to test, do a full build to executable (dx9, or you'll get a blank screen).
  • directToRift.exe doesn't work for me (because dx9?) so I have to:
    - switch on the rift which will enable extended desktop mode and make rift the primary if you've done the above setup - you can tell if you've done this right because the secondary doesn't have a clock/systray (i.e. your main monitor should have no clock - it'll be very obvious anyway if you have judder!)
    - with windows explorer (if necessary, mouse over it on the task bar hold still, right click the preview image, restore if necessary (sometimes twice), click move, use the arrow keys to bring it on screen), find the executable and run it - helpfully it tends to come up spanning both screens for me.
    - alt-tab to get the mouse back, drag the game window over to the rift side.

    Then the game runs with no judder on my box, and F1 does have a noticeable effect.
  • New Participant
    August 1, 2014
    "vrdaveb" wrote:
    "IronfireDave" wrote:
    how do the Oculus guys have it configured?

    We've tested a range of setups, but here is what I usually use: Haswell i7, GTX 780, 16GB, Win7 Ultimate, 2 monitors (no desktop mirroring), DK2, Unity 4.5.2f1. Since I have multiple monitors, I use extended mode to avoid judder. OVRService is running.


    I've got pretty much the same setup, but my screen goes gray as soon as I hit play. I feel like I'm missing something very simple. My scene works fine if I build it and run DirectToRift, but in editor the cameras don't seem to be working. I'm running the Tuscany demo and a demo scene I made with very little modification. Just dragged the PlayerController into the scene.

    Additional weird note: I see the Black fade to a "No Camera Gray" with the PlayerController in the scene.
    Up and Coming
    August 1, 2014
    Have you disabled Dx11 (enabled dx9)? That was causing it for me. Not that the in-editor game view is worth using for me, too juddery. Now that I've figured out how to build so that direct_to_rift will work, that's how I'm working. It's a bit of a slow change->test cycle, but I grew up hand-compiling z80 assembler on paper and typing the hex by hand then reloading from tape whenever it crashed, so I'm accustomed to a little inconvenience ;) Unfortunately much as I'd like to get my game running in DK2, I'm more than a little obsessed with Elite: Dangerous right now...
    New Participant
    August 1, 2014
    Yeah I had DX11 unchecked. I restarted Unity and got it to work briefly by having just one Game window on the extended screen for the Rift. As soon as I added the second window, it went back to its old gray behaviour.

    I'm dealing with the build -> test cycle right now. I'm mainly just messing around right now. Looking forward to the Unity updates I'm hearing about, though! Should make things a lot easier.
    Up and Coming
    August 2, 2014
    I extended my display and made fill the screen in the DK2 (like I normally would with the DK1). The problem is when I try the Tuscany demo I see a floating plane that has the scene rendered onto it. The plane moves around as if in relation to the positional tracking although really glitchy. It is very strange and not at all like the test scene from the config tool or like developing with the DK1. Any ideas?
    Up and Coming
    August 2, 2014
    "jakeleehigh" wrote:
    I extended my display and made fill the screen in the DK2 (like I normally would with the DK1). The problem is when I try the Tuscany demo I see a floating plane that has the scene rendered onto it. The plane moves around as if in relation to the positional tracking although really glitchy. It is very strange and not at all like the test scene from the config tool or like developing with the DK1. Any ideas?


    That happened to me once when I was meddling with the camera options. I couldn't figure it out - I quit unsaved and on reloading it was ok. Maybe try starting a new project from scratch?