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 30, 2014
    "jherico" wrote:
    I was hoping to see some different behavior in x64 (I normally build in 32 bit mode, like a scrub), but no joy.


    Are you using the official SDK or your own repository? I recently switched to your repository because it's setup to build a DLL. [By the way, thank you so much for that it really saved me a lot of time; let's hope Oculus will do the same!] When I made the same changes to comment in OpenGL the application doesn't crash but the light doesn't turn blue and the screen never gets activated. If you're testing with your repository, are you able to get it to work with the official one like some of us have? If so I wonder if something about it being in a DLL is affecting the order of initialization somehow.
    Up and Coming
    October 24, 2014
    Anyone had a go with 0.4.3 yet? I'm not going to be able to test it until Monday..
    Participant
    October 24, 2014
    I'm able to get Direct HMD mode with OpenGL working with my app using 0.4.3. I was never able to even get the HMD light to turn blue using the previous SDK. So it's definitely an improvement!

    My process seems to take a while to exit now, but I haven't spent too much time looking into it.
    Up and Coming
    October 24, 2014
    "flashk" wrote:
    I'm able to get Direct HMD mode with OpenGL working with my app using 0.4.3. I was never able to even get the HMD light to turn blue using the previous SDK. So it's definitely an improvement!

    My process seems to take a while to exit now, but I haven't spent too much time looking into it.


    Excellent; all you had to do was make the minor changes to the function call renames for the Direct to Rift support?
    Participant
    October 24, 2014
    "tmason101" wrote:
    Excellent; all you had to do was make the minor changes to the function call renames for the Direct to Rift support?


    Yeah, I just had to account for some renames, but didn't have to make any other changes. I did notice that ovr_Initialize() must be called before the graphics window is created, otherwise the HMD won't display anything.

    However, I did notice a problem where the HMD resolution is affected by the application window size. I've reported it in this thread.
    Up and Coming
    October 24, 2014
    Thank you, helpful information!
    Up and Coming
    October 27, 2014
    "flashk" wrote:
    I'm able to get Direct HMD mode with OpenGL working with my app using 0.4.3. I was never able to even get the HMD light to turn blue using the previous SDK. So it's definitely an improvement!

    My process seems to take a while to exit now, but I haven't spent too much time looking into it.


    Awesome, that sounds promising. Unfortunately I'm still not having much luck - I get a crash on the first swapBuffer call after ovrHmd_AttachToWindow()

    Would you mind sharing whether you're using SDK or client rendering, what sort of openGL context you're requesting and at what point you call attach (Before or after the window is shown / swap buffers is called for example)?

    Thanks!
    Participant
    October 27, 2014
    As of 0.4.3 direct-to-HMD seems to work for me under OpenGL, but I'm also experiencing issue where the HMD screen resolution seems locked to that of the application window. Mirroring works when enabled, but this has no effect on the HMD resolution issue either way. No luck finding a way around this yet.

    This is my initialization order:

    • ovr_Initialize

    • ovrHmd_Create

    • Create the window

    • Create the OpenGL context

    • ovrHmd_SetEnabledCaps

    • ovrHmd_ConfigureRendering

    • ovrHmd_AttachToWindow

    • ovrHmd_ConfigureTracking


    "rsjtaylor" wrote:
    Unfortunately I'm still not having much luck - I get a crash on the first swapBuffer call after ovrHmd_AttachToWindow()


    Is this crash coming from within the Oculus SDK? If not, you shouldn't be swapping the buffers manually when rendering to the HMD, let ovrHmd_EndFrame handle this for you.
    Up and Coming
    October 27, 2014
    "sunnyjum" wrote:
    As of 0.4.3 direct-to-HMD seems to work for me under OpenGL, but I'm also experiencing issue where the HMD screen resolution seems locked to that of the application window. Mirroring works when enabled, but this has no effect on the HMD resolution issue either way. No luck finding a way around this yet.

    This is my initialization order:

    • ovr_Initialize

    • ovrHmd_Create

    • Create the window

    • Create the OpenGL context

    • ovrHmd_SetEnabledCaps

    • ovrHmd_ConfigureRendering

    • ovrHmd_AttachToWindow

    • ovrHmd_ConfigureTracking


    "rsjtaylor" wrote:
    Unfortunately I'm still not having much luck - I get a crash on the first swapBuffer call after ovrHmd_AttachToWindow()


    Is this crash coming from within the Oculus SDK? If not, you shouldn't be swapping the buffers manually when rendering to the HMD, let ovrHmd_EndFrame handle this for you.


    Do you happen to be using GLFW? My app crashes now when I use GLFW with the Oculus Rift but works fine when the Rift isn't turned on.

    Just curious.

    Thanks.
    Participant
    October 27, 2014
    "tmason101" wrote:
    Do you happen to be using GLFW? My app crashes now when I use GLFW with the Oculus Rift but works fine when the Rift isn't turned on.


    Nope, I'm setting up the OpenGL context manually