Skip to main content
New Participant
March 28, 2015

Project with OVR always builds for Rift, even if not used?

I have asked this on the unity3d forums as well, not sure if it's a unity problem or a oculus integration problem.

Using the following
Unity 4.6.3f1
Oculus Integration 5.0.1

I have a test project that has an Oculus Camera Rig (enabled) as well as a Main Camera (disabled) in a single scene.

When I build the project it builds as expected, and when I run either Test.exe or Test_DirectToRift.exe it shows up in my Rift as expect.

Here is the issue I am having,

So I go back to my project, disable any Oculus scripts and objects, end enable the Main Camera. In the editor it works as expected, no rift eyes . I build like before, and run either Test.exe or Test_DirectToRift.exe, instead of NOT running in the Rift, it does run in the rift. No rift eyes in Rift either, which is good, just on the wrong screen.

So am I missing something here? Or is it, if you have the Rift OVR classes and DLLs in your project even if you don't use them, when you build, it builds to use the Rift as the output target regardless?

Basically I'm trying to create test were I can run it like normal, and then run in in Rift mode, same build executable for both. Can that even be done? I don't want to really be building two separate projects.

Thanks
    This topic has been closed for replies.

    6 replies

    Up and Coming
    March 28, 2015
    *Removed due to incorrect answer* (was tired so i read the question wrong :P Sorry about that!)
    ASUS Maximus VII Formula Intel core i7 quad core 4790K OC'ed @ 4.4Ghz 32GB DDR3 Ram Nvidia Geforce GTX 980 4GB Windows 10 Pro 64bit GSync Monitor @ 2560x1440, 144Hz ------------------------------------------- DK2 Owner CV1 Preordered.
    Inspiring
    March 28, 2015
    There should be a way to do this. I can check on Monday.
    AMD Ryzen 7 1800X | MSI X370 Titanium | G.Skill 16GB DDR4 3200 | EVGA SuperNOVA 1000 | Corsair Hydro H110i Gigabyte RX Vega 64 x2 | Samsung 960 Evo M.2 500GB | Seagate FireCuda SSHD 2TB | Phanteks ENTHOO EVOLV
    Up and Coming
    March 28, 2015
    Wait, i might have misunderstood your situation...
    is your Rift turned on whenever you play the build for the standard screen??? do you have set your rift in either extended mode or direct mode??? it is important to know because i can't quite figure out exactly what you mean by:

    instead of NOT running in the Rift, it does run in the rift. No rift eyes in Rift either, which is good, just on the wrong screen.


    it is a little confusing to me as i have never experienced people have this kind of problem if their Rift is turned off when playing their recent builds...

    Hope you get it to work properly ;)
    ASUS Maximus VII Formula Intel core i7 quad core 4790K OC'ed @ 4.4Ghz 32GB DDR3 Ram Nvidia Geforce GTX 980 4GB Windows 10 Pro 64bit GSync Monitor @ 2560x1440, 144Hz ------------------------------------------- DK2 Owner CV1 Preordered.
    cdngaterAuthor
    New Participant
    March 29, 2015
    Hi

    Yeh, I'm not asking how to switch in code, that's something I already do.

    No, I'm talking about building and running the exe.

    My understanding was that the exe did not run on the rift directly, and running the DirectToRift did run on the rift.

    Also, yes my rift is still plugged in and in extended mode, but I thought that wouldn't matter if I just ran the test.exe instead of test_DirestToRift.exe.

    My assumption I guess is that when running test.exe the display would be on my normal monitors, and when I run test_DirectToRift.exe then the display would be on the rift. Instead, they both run in the rift, which means if I want to distribute my test project without rift I have to take the SDK out if the project and make a new build.

    EDIT: interesting, something you said above got me thinking. If I turn off the rift, then the display is in the monitor as I expected. But if the rift is on, then it goes to that instead, even if I have the rift classes disabled in the project.
    Inspiring
    March 29, 2015
    Sorry, this is not really clear. With Unity builds, running YourGame.exe will never work. I'm not sure of the technical reason for this, it just doesn't work. You need to be using the YourGame_DirectToRift.exe at all times (both in Direct and Extended Mode).
    AMD Ryzen 7 1800X | MSI X370 Titanium | G.Skill 16GB DDR4 3200 | EVGA SuperNOVA 1000 | Corsair Hydro H110i Gigabyte RX Vega 64 x2 | Samsung 960 Evo M.2 500GB | Seagate FireCuda SSHD 2TB | Phanteks ENTHOO EVOLV
    cdngaterAuthor
    New Participant
    March 29, 2015
    Ok cyber thanks, I think I understand.

    if we build an exe that incorporates oculus, then it's going to run on the oculus rift if it's turned on regardless and not be software controlled.

    Interesting, as it makes all the nifty switching scripts I see here, totally useless as its going to use the oculus rift anyway if it's turned on.

    So I would need to come up with a message for the user like this: "if you want to run the application in non Oculus mode, then please turn off the Oculus Rift as the drivers will detect it and use it even though it's turned off in this application"?