Forum Discussion
philippM
11 years agoHonored Guest
Status of openGL direct-to-HMD as of 0.4.2
I got my application working in client-rendered, extended desktop mode, using openGL on Mac.
When trying on Windows, it works okay so far, but I can't seem to enable direct-To-Rift mode.
I call ovrHmd_AttachToWindow() with no visible effect, the distorted render output stays on the main display where it was, and the Rift stays dark.
I run Windows 7, an AMD HD8970 with Catalyst 14.4 and oculus runtime 0.4.2.
I read that openGL and Direct-to-HMD is not working anyway, much less on AMD, but I would like to confirm that ovrHMD_AttachToWindow() just doing NOTHING is what is expected to happen as of now, as I've read several forum threads where it fails differently, but they might be older than 0.4.2.
When trying on Windows, it works okay so far, but I can't seem to enable direct-To-Rift mode.
I call ovrHmd_AttachToWindow() with no visible effect, the distorted render output stays on the main display where it was, and the Rift stays dark.
I run Windows 7, an AMD HD8970 with Catalyst 14.4 and oculus runtime 0.4.2.
I read that openGL and Direct-to-HMD is not working anyway, much less on AMD, but I would like to confirm that ovrHMD_AttachToWindow() just doing NOTHING is what is expected to happen as of now, as I've read several forum threads where it fails differently, but they might be older than 0.4.2.
48 Replies
- jhericoAdventurerMy own experience has the application crashing if you try to run DirectHMD mode with OpenGL, though it depends on the order of operations (whether you initialize the SDK before or after you initialize the OpenGL context).
Ultimately I have not heard of anyone getting DirectHMD working with OpenGL. - philippMHonored GuestThanks for confirming that.
Is there an officially suggested ORDER of what to initialize when? - philippMHonored GuestSo I found it is recommended that you call ovr_Initialize() before creating any openGL contexts.
If I do this, I get an immediate BSOD when calling ovrHmd_AttachToWindow() and my computer reboots. Wow. - nuclearExplorerMy own experience with trying to use OpenGL with ovrHmd_AttachToWindow() (win 7, nvidia drivers) is that it does nothing, regardless of the order of ovr_Initialize() and context creation.
- jhericoAdventurer
"philippM" wrote:
So I found it is recommended that you call ovr_Initialize() before creating any openGL contexts.
If I do this, I get an immediate BSOD when calling ovrHmd_AttachToWindow() and my computer reboots. Wow.
Yeah, I think Oculus would be better served working with AMD and nVidia to get an OpenGL extension set up, rather than trying interject stuff into drivers. - rsjtaylorHonored GuestI've found that if you request a core profile you get a crash on context creation, while a compatibility profile doesn't crash but doesn't work either. This is with opengl 3.2 & an nvidia card, calling initialize render shim before context creation & attach to window at various different points.
- jhericoAdventurer
"rsjtaylor" wrote:
I've found that if you request a core profile you get a crash on context creation, while a compatibility profile doesn't crash but doesn't work either. This is with opengl 3.2 & an nvidia card, calling initialize render shim before context creation & attach to window at various different points.
Sorry, yes, you're correct. The choice of the rendering profile does affect whether you get a crash, at least on my system. Nothing I've done though has ever made it work. - jhericoAdventurerActually, while pondering this, it occured to me that there may actually be a sort of hacky solution (at least on nVidia cards). Use OpenGL for your rendering engine, and use DirectX for interacting with the Rift screen.
nVidia has an extension which is integrated into recent drivers that allows for interoperability with OpenGL.
It may be possible to create a very small Direct3D shell. Once you've got your rendered OpenGL textures, you could grab a corresponding pair of Direct3D textures, blit the results over and hand the Direct3D textures to the SDK. It's not ideal, but it would potentially resolve the issues of judder and lack of DirectHMD mode for OpenGL applications.
I'll keep looking into this and see if I can come up with a functional example. - RajveerExplorerGood idea. Oculus mentioned in a few other threads that they've solved most OpenGL issues and have an unstable driver where Direct to Rift works. Could we get an update on a timeframe for release (days, weeks, months)? I don't want to waste time going the DX route if they release an update soon, but also don't want to hang around waiting for them if they take ages to release it.
- jhericoAdventurer
nVidia has an extension which is integrated into recent drivers that allows for interoperability with OpenGL.
I had a brief go of this over the weekend. DirectX is not normally in my bag of tricks, so it's slow going, but fortunately I'm able to simply replicate most of the code from the OculutTinyRoom demo.
I haven't gotten actual output from the headset yet, although all the code seems to be there. I've discovered a couple gotcha's that anyone else experimenting might want to know....- As previously noted, creating an OpenGL core profile context will fail if it's done after the ovr_Initialize() call. You must create your OpenGL window / context before setting up the SDK. It doesn't really matter what the size of the OpenGL window is, or even if it's visible.
- The Direct3D window on the other hand must be created after the ovr_Initialize() call. If you create a Direct3D window before the SDK is started up, when you attempt to attach to it using ovrHmd_AttachToWindow() the Rift (in Direct HMD mode) will not activate.
I may take another crack at this tonight, seeing if I can get any output using Direct3D alone, so that I know my D3D pipeline is complete, before attempting again to write to the D3D texture using OpenGL.
Quick Links
- Horizon Developer Support
- Quest User Forums
- Troubleshooting Forum for problems with a game or app
- Quest Support for problems with your device
Other Meta Support
Related Content
- 10 months ago
- 4 months agoAnonymous