Skip to main content
Participant
August 25, 2015

Direct mode - game window on monitor stays black

Hi,

I have my own game engine that uses a java passthrough library to talk to the SDK. Whenever I use the Rift the main game window stays black while the Rift works perfectly fine. What is the best way to send graphics data to both the Rift and the default OpenGL window? Is there a property in the SDK for it or is there a way to disconnect the rift from hijacking the screen, draw to it and then reconnect the rift (without it slowing down the rendering)? While it would be great to draw only one of the FBO's that are sent to the rift I'd be fine with it just mirroring what the Rift sees as well.

Mike

EDIT: I was doubting if this post should be here or in "Other Engine Integrations", please move it if you want to.

    8 replies

    Inspiring
    August 25, 2015
    "mike997" wrote:
    I have my own game engine that uses a java passthrough library to talk to the SDK. Whenever I use the Rift the main game window stays black while the Rift works perfectly fine. What is the best way to send graphics data to both the Rift and the default OpenGL window?


    It depends on what version of the SDK your Java passthrough library is using. If it's using 0.6 or later, then you can either take the same textures you're passing to the ovr_Submit call and display them on the OpenGL window, or you can create a mirror texture using the ovr_CreateMirrorTextureGL function. After ovr_Submit, the mirror texture will have the scene displayed on the Rift (post composition) and you can display that on your OpenGL window.

    The only real caveat here is that you must disable v-sync on the on-screen OpenGL window or when you draw the texture and call swap buffers, you will throw off the timing of the rendering and display to the Rift itself.
    Brad Davis - Developer for High Fidelity Co-author of Oculus Rift in Action
    mike997Author
    Participant
    August 25, 2015
    Thanks for the answer!

    I'm currently on SDK 0.5 so that isn't an option.

    The demo scene has always displayed the scene on both the OR direct mode and the DirectX window, is it doing all the rendering twice as it is quite a cheap scene or is there some other method for non-0.6?

    Mike
    Game in pre-alpha with support for Oculus Rift DK2 coming in the next patch, State of Fortune
    Inspiring
    August 25, 2015
    Any reason you can't update to the newer SDK?
    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
    mike997Author
    Participant
    August 25, 2015
    Because I'm using JRift which seems to be the most active library, and that one didn't get updated for a few months. I'm guessing Oculus isn't planning on releasing a supported Java library anytime soon?
    Game in pre-alpha with support for Oculus Rift DK2 coming in the next patch, State of Fortune
    Inspiring
    August 25, 2015
    No plans for Java that I know of. Sorry.
    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
    August 27, 2015
    LWJGL 3 now has beta Java support for the Rift via their LibOVR. I've been working with the developers and it's now supporting the latest Rift SDK. I have some basic code that demos it's usage:

    https://github.com/WhiteHexagon/example-lwjgl3-rift

    I'm afraid it's windows only as per latest Rift SDK, but they plan to add mac support back in once the Rift SDK is supporting it again...
    DK2, MBP (mid 2010) OSX 10.10.3. Win7 - i5 4670K - GTX770. Java LWJGL 3 OpenGL Experiments: https://github.com/WhiteHexagon
    mike997Author
    Participant
    August 27, 2015
    "whitehexagon" wrote:
    LWJGL 3 now has beta Java support for the Rift via their LibOVR. I've been working with the developers and it's now supporting the latest Rift SDK. I have some basic code that demos it's usage:

    https://github.com/WhiteHexagon/example-lwjgl3-rift

    I'm afraid it's windows only as per latest Rift SDK, but they plan to add mac support back in once the Rift SDK is supporting it again...


    Awesome news :) Time to upgrade to LWJGL 3 now that it's getting more and more stable!

    Thanks!
    Game in pre-alpha with support for Oculus Rift DK2 coming in the next patch, State of Fortune
    Inspiring
    August 28, 2015
    Damn, and I was almost done updating JOVR for 0.7
    Brad Davis - Developer for High Fidelity Co-author of Oculus Rift in Action