New To The Forum? Click Here To Read The How To Guide. -- Developers Click Here.

Using Oculus SDK with existing initialized OpenGL context

pixeratipixerati Posts: 8
NerveGear
I'm trying to build a plugin for the Rift with Autodesk's Motionbuilder. It has it's own encapsulated Rendering class so I just need to feed it FBOs and it'll render to them. The problem is I can't seem to initialize the Rift without it creating it's own independent window, rather than using the existing context set up by the host app Motionbuilder. So I think that when I try to bind the FBO, it's binding to the Rift window's context (I borrowed code from the Tiny Room project) and not actually handing its FBO to the host app's OpenGL instance (i.e. Motionbuilder).

I'm pretty new to OpenGL, but is this accurate and if so how can I get the Rift to work with the host OpenGL context instead of trying to set up its own?

Comments

  • imperativityimperativity Posts: 1,604 Oculus Staff
    Hi,

    I have forwarded your question to the SDK team for their review. I should have a fairly decent amount of information to share with you about this use case next week. Thanks for your patience!
  • pixeratipixerati Posts: 8
    NerveGear
    Great, thanks.
  • imperativityimperativity Posts: 1,604 Oculus Staff
    @pixerati

    I have some feedback to share with you from our PC SDK team:

    "The Rift SDK doesn't require the app to create a separate window beyond what it already has. It can create a GL context and render with it. The ORT sample has code written that explicitly creates a window but the window is for mirroring purposes as well as capturing user input (mouse+keyboard) which is a Windows requirement. There's also focus management where the Oculus runtime will select a single VR app to be in focus using the ovrSession ID as well as the process ID.
    The developer coding the VR app needs to make sure the frame buffer its rendering to has its source textures created by the Oculus SDK, and not by the VR app code, or at the very least the VR app needs to blit its own frame buffer contents finally into the SDK created eye textures."

    Let me know if you have any further questions.
  • pixeratipixerati Posts: 8
    NerveGear
    Thanks. Yes, I found some of this on a couple of other forum posts. I think blitting is probably my best bet. Will try to incorporate in the next couple of days. Thanks for taking the time to follow up.


  • pixeratipixerati Posts: 8
    NerveGear
    OK, so here's what's grinding me to a halt every time:

    the glGenFramebuffers function.

    This crashes without fail. From what I can tell, this is typically because glewInit() hasn't been called. But I can't call it, because OVR_CAPI_GL.h won't let me include it. Any ideas?
  • pixeratipixerati Posts: 8
    NerveGear
    Seems the problem is that OVR_CAPI_GL.h is using an incompatible version of Glew...? Can I override this?
  • pixeratipixerati Posts: 8
    NerveGear
    Found this in an old thread. Hard to believe this is still an issue from 2014, but I'm getting the same kind of exception with the glGenFrameBuffers crash. Does anyone on the Oculus team have a suggested workaround?

    https://forums.oculus.com/community/discussion/13903/opengl-0-4-2-please-stop
Sign In or Register to comment.