Forum Discussion

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

Buld & Run direct to Rift?

Is there a way to launch the direct to rift executable from the "Build & Run" menu option, rather than the standard exe?
I run my game in direct to Rift mode, works perfectly. Would love to just start a build and run and it launches it to the Rift. I know it builds it

3 Replies

Replies have been turned off for this discussion
  • Yes, but it can get complicated, so I would only recommend doing the following on a developer machine.

    The main function of "DirectToRift.exe" is to load the direct mode driver before Unity initializes D3D. You can accomplish that with the "naked" executable by loading our driver instead of the usual D3D DLLs. However, you'll have to ensure the app starts at 1920x1080 and in the right full-screen state. That means passing the "-window" argument in direct mode and the "-fullscreen" argument in extended mode. Or you can hold ALT the first time the application runs to force the resolution dialog to appear. There, you can choose the resolution, full-screen state, and (4.5.3+ only) the target monitor. For Unity 4.5.2 and earlier, when in extended mode, this won't work. Unity would have to include the "-adapter N" argument, where N is the display number of the Rift.

    Note that if you're running in extended mode, our driver will actually cause crashes and force the wrong resolution if you load it. So only do the following if you're running in direct mode:
    1) copy C:\Windows\SysWOW64\OVRDisplayRT32.dll or C:\Windows\system32\OVRDisplayRT64.dll to the same directory as the app binary.
    2) Make two copies of the DLL in that directory.
    3) Name the first copy "d3d9.dll"
    4) Name the second copy "dxgi.dll"
    5) Make sure you are using direct mode.
    6) If you want to run in extended mode, delete or rename both of the DLLs.

    Now if you select "build & run", it should work as expected.
  • Anonymous's avatar
    Anonymous
    great, thanks! I'll try that as soon as I can.
  • Anonymous's avatar
    Anonymous
    hmmm I tried it but couldn't get it to work. I'm in direct mode, not Extended.

    copied and renamed 2 OVRDisplayRT32.dll, ran @1080 with windowed checked. Crashed
    copied and renamed 2 OVRDisplayRT64.dll, ran @1080 no crash but doesn't run the game in Rift, just a single camera.