cancel
Showing results for 
Search instead for 
Did you mean: 

OpenGL context management VS Oculus

eskil
Honored Guest
Hi

I'm having some issues with writing a Oculus plugin for a platform layer i have.

To explain my issue i need to explain a bit about my plugin interface. The platform layer opens a window and creates a openGL context, then once this is done it will look for plugins. Plugins can do all sorts of things but in this example all that matters is rendering. When a plugin gets initialized, if can tell the API that it wants to intercept the applications rendering. When this call is made the Platform layer will create an additional OpenGL context and use wglShareLists to link it to the openglContext linked to the window. Then the once the plugin is activated, the plugin will take over the main rendering look, and can trigger the applications main render loop as many times as it likes and then present the result to the screen. The API intercepts FrameBufferBinds so that the application actually draws to a texture when it binds FBO 0, (Kind of nifty right? :-))

I have written a fair bunch of plugs for this to do color correction, and DK1 pluging among other things, but i cant get it to work with the new API. The issue I'm having is that it works on screen but it doesn't show up in the HMD. I assume that the rendering is working since it is warping and tracking correctly, but is unable to capture the image for some reason.

Right now the order of things are like this:

-OpenWindow.
-Create a GL Context /* WONT BE USED BY OCULUS! */
-ovr_Initialize()
-ovrHmd_Create();
-Create the GL Context the oculus renderer will use.
-ovrHmd_AttachToWindow();
-ovrHmd_ConfigureRendering
-create my textures in the oculus context.

Is this wrong, and if so how can it be wrong? I do create the window before i run ovr_Initialize, but I'm not giving ovr access to it until later and i am creating the context that will be used later. ovr shouldnt be able to care if i have an other open gl context. I'm assuming that ovr needs to create its own context and use wglShareLists, so it would matter that it gets access to the render context before the textures are created. I'm a bit lost here. If you like i can send you source code. I would be very interested to know how the capturing of the image has been implemented.

Cheers

E

Side note: the 64bit service exe crashes, the 32 bit works, im running 64 bit windows, a 64 bit app and all demos work fine.
22 REPLIES 22

eskil
Honored Guest
I managed to figure it out by searching my registry. Still cant get my code to run...

eskil
Honored Guest
So I have just spent another day on this and I'm not getting anywhere. I have tried 0.4.3 and 0.4.4, i have tried on AMD (my main dev machine) with latest drivers and 14.4 drivers and I'm now trying to get it to work on a nVidia machine, but its "waiting for camera" and the service doesn't run on that machine. The service does run on my main machine but only the x86 version (despite the OS being x64), bot the 64 bit version and the launcher crashes. I have removed all my multiple contexts and written a very straight forward implementation, still doesnt work. I have moved around all calls and tried all kinds of combinations of ordering becoming increasingly unlikely to be right. My application is pure C and doesn't link to any external libs beyond windows and openGL. Tracking is working fine, and so is the rendering in the window, (it warps correctly and even shows the health warning) but nothing shows up in the HMD. The HMD flashes for a split second when the application starts, so its getting some kind of initialization. The demo scene in the Oculus Configuration Utility works fine, and shows up in the display.

I don't know what more to do.

I know that the people from oculus answering questions in this forum aren't necessarily the people responsible for the implementation of OVR, and any negative vibe you get from me is purely a result of my frustration and is in no way directed at anyone personally. I'm just trying to get some kind of clue as to why its not working. I really want Oculus to succeed.

sebjf
Honored Guest
Hi, 

Could someone confirm whether this behaviour (hooking OpenGL) still occurs in the latest SDKs? (1.3.0)

I am also trying to integrate the Oculus SDK with an existing platform via a plugin, and am encountering very odd behaviour that does not occur when I move the code into one of the SDK samples.

(Eskil, if you still receive notifications on this thread, did you ever get your application working?)

Sj