Skip to main content
Up and Coming
September 12, 2014

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.

    48 replies

    Up and Coming
    September 28, 2014
    "gplourde" wrote:

    What windows version are you using?


    I'm on Windows 7, building with VS2010.
    Up and Coming
    September 29, 2014
    But isn't it already a bit worrying that you would need "D3DCompiler_47.dll" to be able to run your "pure OpenGL direct-to-HMD" program?
    Linux won't have it, OSX won't have it.
    Up and Coming
    September 29, 2014
    It doesn't not need it no. Its just that they do a dirty switch to GL in the worlddemo code and still define window as the platform so all over the place the code refer to d3d and link to it.
    Up and Coming
    September 29, 2014
    "DoZo1971" wrote:
    But isn't it already a bit worrying that you would need "D3DCompiler_47.dll" to be able to run your "pure OpenGL direct-to-HMD" program?


    I have another application built on OpenSceneGraph and OpenGL which is not linked against D3D. Direct mode isn't working that great; the right channel seems to have some viewport issues but it was at least turning the light from orange to blue and lighting up the screen.
    Up and Coming
    September 30, 2014
    I know, this will probably be in vain, but:

    Could someone from Oculus please shed some light on this?

    After 0.4.1 was more or less confirmed to be broken, we all believed that it was still not working at all in 0.4.2. Now after most have given up and there has even been an approach to feed OpenGL results through Direct3D it turns out, that the so desired feature has been in 0.4.2 all along..?

    While I understand, that fixing issues takes time and ETAs cannot be given, it would be nice, to at least clear up what the current state of direct mode is supposed to be...
    Atlantis: Infinite Coaster
    Up and Coming
    September 30, 2014
    I was just about to post this too, but too thought it would be in vain.
    Up and Coming
    September 30, 2014
    "JeffBail" wrote:
    I think I may have direct mode working with GL but since everyone says it doesn't work I want to make sure I'm not just making a mistake in my configuration somewhere. I took the stock 0.4.2 SDK and changed OculusWordDemo.cpp as follows to comment in GL support:


    //#if defined(OVR_OS_WIN32)
    // const char* graphics = "d3d11";
    //#else
    const char* graphics = "GL";
    //#endif


    I rebuilt it and then copied the executable from the build directory (Samples\OculusWorldDemo\Bin\Win\VS2010\Release\x64) to the directory where the stock example seems to be installed (Samples\OculusWorldDemo\Release). When I run it in direct mode the light on my rift goes from orange to blue and the frame rate is reported as 75Hz (though it occasionally dips down from there as I move my head around). The window title shows "GL" instead of dx3d11 and just to be completely sure I also ran it through gDEBugger and made sure I could break on GL calls.


    I tried this as well. Changed the lines as above and rebuilt everything. Got it to work in direct mode as you describe. But only if I compile for x64, if I compile it for win32 it does not work.

    Compiled with on Win7, VS2010, Nvidia GTX570 - Driver 344.11.
    Up and Coming
    September 30, 2014
    In the hopes that x64 would work for me, I went home and added support for it in my engine but unfortunately it still crashes with direct mode. I wonder what the x64 version of OculusWorldDemo is doing differently.

    Windows 7 x64, VS2013, Nvidia GTX670 SLI (SLI was disabled and only a single screen was in use), Geforce 344.11 driver.
    Inspiring
    September 30, 2014
    I was hoping to see some different behavior in x64 (I normally build in 32 bit mode, like a scrub), but no joy.

    So, in my experience with the Direct3D integration, the SDK has to be initialized before you create your D3D window for Direct HMD to work. On the other hand, if I attempt to initialize the SDK and then create an OpenGL 3.3 context, I get a crash every time. I have to create the OpenGL context before initializing the SDK for it to work, and based on the D3D behavior, I suspect that won't ever work.

    I haven't tried initializing the SDK and then creating a default context lately. Previously that failed to crash, so I might try it again tonight.
    Brad Davis - Developer for High Fidelity Co-author of Oculus Rift in Action
    Up and Coming
    September 30, 2014
    Huh, I never noticed that. When initialising the SDK after creating my GL context I don't get a crash either (in both Win32 and x64) - it doesn't render to the Rift and still renders to the window, but it doesn't crash (not that that's any better). I've also tried having the context both active and inactive before the SDK initialisation with no effect.

    With extended mode, the order of SDK initialisation and GL context creation doesn't matter for me.