Forum Discussion
mike997
10 years agoExplorer
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.
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
- jhericoAdventurer
"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. - mike997ExplorerThanks 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 - cyberealityGrand ChampionAny reason you can't update to the newer SDK?
- mike997ExplorerBecause 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?
- cyberealityGrand ChampionNo plans for Java that I know of. Sorry.
- whitehexagonExplorerLWJGL 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... - mike997Explorer
"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! - jhericoAdventurerDamn, and I was almost done updating JOVR for 0.7
Quick Links
- Horizon Developer Support
- Quest User Forums
- Troubleshooting Forum for problems with a game or app
- Quest Support for problems with your device