Forum Discussion

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

Should main .exe launch on Rift? How?

As mentioned here: viewtopic.php?f=37&t=23400

Unity 4.6 and OVR SDK 0.6.0 are no longer producing a DirectToRift.exe. Supposedly this is because the main .exe should now be able to target the Rift.

However, this is not my experience with it. Apparently it works under certain conditions and not in others.

Do we understand those conditions? Direct vs Extended mode? What aspect of the OVR Unity code is responsible for targeting the Rift monitor?

I've tried several projects and they all fail to target the Rift correctly. I've brought forward _DirectToRift and that still seems to work.

I'd like to remove _DirectToRift and just use the single exe.

Help?

9 Replies

Replies have been turned off for this discussion
  • xhonzi's avatar
    xhonzi
    Honored Guest
    Bump? Is there no guidance on this? It doesn't seem to work for many of us.
  • I believe the single exe only works with Unity 5.1. For Unity 4.6 you should still need the DirectToRift. I'm not sure why it wouldn't export. Do you have the optimize for VR checked in the properties?
  • xhonzi's avatar
    xhonzi
    Honored Guest
    Cyber- I think you have it backwards.

    This is from https://developer.oculus.com/downloads/ ... tegration/:
    Eliminated the need for the DirectToRift.exe in Unity 4.6.3p2 and later.

    If you look at the OVR shim, it only detects 4.X and over 4.6.

    4.6 is definitely not generating the DirectToRift.exe. 5.0 is. Not sure about 5.1.
  • Yeah, you're right. I have Unity 4.6.5p3 and it DOES NOT create DirectToRift but the exe DOES still work.
  • xhonzi's avatar
    xhonzi
    Honored Guest
    I guess that's the point- it doesn't work in some cases, but does in others. Do we understand these cases?

    Is there a DirectX 9 vs 11 issue here?
  • xhonzi's avatar
    xhonzi
    Honored Guest
    Looks like I missed that. I switched my game to Dx11.

    Regular EXE still launches on main monitor. Anything else I should be checking?

    EDIT: Just reading the Shim a little more- you can force the DirectToRift exe to get delivered if you mess with the _useAutoPatcher bool. Probably not recommended.

    There's a comment there about has PreInitSupport that says:
    //If true, Unity can use OculusInitPlugin instead of _DirectToRift.exe.

    Soo... how do we troubleshoot the OculusInitPlugin? Where is it? Is it sealed in the dll?
  • xhonzi's avatar
    xhonzi
    Honored Guest
    I see the OculusInitPlugin.dll in the plugins directory. Anything special to make it work? I don't see anything referencing it anywhere. My Dx11 build still doesn't launch on Rift without DirectToRift.

    EDIT: A quick inspection into the .dll shows that it only has one exported function: UnitySetGraphicsDevice. You can do some reading about it here: http://docs.unity3d.com/Manual/NativePl ... rface.html

    Looks like it should get called when Unity first starts the graphics engine, and theoretically can determine which monitor is the Rift.

    It doesn't answer why it's not working on my project (either Dx11 or Dx9)... but it's interesting.