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

    Participant
    September 15, 2014
    "jherico" wrote:

    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.


    it'd be super cool/useful if u did this on github or something so we can learn from the process :D
    Inspiring
    September 15, 2014
    "trippedout" wrote:
    "jherico" wrote:

    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.


    it'd be super cool/useful if u did this on github or something so we can learn from the process :D


    Everyone wants a piece of the 'Jherico'.

    Yes, it will be on GitHub if I can get a working version. Probably even if I don't I'll put it in a branch so people can play with trying to get it working.
    Brad Davis - Developer for High Fidelity Co-author of Oculus Rift in Action
    Inspiring
    September 16, 2014
    Well, it works... sort of. I say sort of, because the Direct3D window renders the image upside down, due to the inversion of the Y texture coordinate between OpenGL and Direct3D. I'm trying to figure out if there's a switch I can flip to fix this, or if I'll need to blit the texture to invert it somehow.

    However, I am getting judder free rendering in DirectHMD mode with OpenGL rendering code. There is some slight tearing though, not sure why.

    I basically had to rip out the guts of the TinyRoomDemo to get the Direct3D initialization stuff, because apparently my attempt to copy only the specific functions I needed simply didn't work properly.

    The (rather lengthy, because of the Direct3D boilerplate) code is located here.
    Brad Davis - Developer for High Fidelity Co-author of Oculus Rift in Action
    Up and Coming
    September 26, 2014
    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.
    Up and Coming
    September 26, 2014
    You missing the part where you check if your rift is set to,

    Direct HMD Access from apps
    or
    Extended Desktop to the HMD

    is it?

    Oh and the graphic card and driver you use. Could the latest nvidia driver fix this?
    Up and Coming
    September 26, 2014
    My Rift is set to Direct HMD. I'm on NVIDIA 344.11, though it was also working for me on the previous version (340.52).
    Up and Coming
    September 27, 2014
    Nope still doesn't work.

    What windows version are you using?
    kojack
    Honored Contributor
    September 27, 2014
    I'll back JeffBail up on this. I just tried the same, OpenGL is working fine in Direct to rift mode for the 0.4.2 world demo.
    I single stepped through the code, it's not falling back on dx11, it's using the OVR::Render::GL::Win32::RenderDevice. The debug log shows GL_VERSION: 4.4.0
    The config system tray app is set to direct to rift mode and it works correctly (rift is in standby, when the app starts the rift turns on with the correct display, and the primary monitor shows a smaller 1100 x 618 with the mirrored display.

    This is on Windows 7, Geforce GTX680, Driver 332.21.
    Author: Oculus Monitor , Auto Oculus Touch , Forum Dark Mode , Phantom Touch Remover , X-Plane Fixer Hardware: Threadripper 1950x, MSI Gaming Trio 2080TI, Asrock X399 Taich Headsets: Wrap 1200VR, DK1, DK2, CV1, Rift-S, GearVR, Go, Quest, Quest 2, Reverb G2, Quest 3
    Up and Coming
    September 27, 2014
    This works for me too (Windows 7, Nvidia driver 344.11). Btw if you compile with VS2013 and it fails to run outside of it due to missing "D3DCompiler_47.dll", run it from within Visual Studio.
    Up and Coming
    September 27, 2014
    It fail on ParseGLVersion for me in anything I do with open gl including the the worlddemo.

    Windows 8.1
    GTX 980, GTX 690
    Driver 344.16

    So far I point at windows 8.... I'll give windows 7 a try.