bjornblissing / osgoculusviewer

An OsgViewer with support for the Oculus Rift
Other
106 stars 67 forks source link

Support SDK assisted rendering #25

Closed bjornblissing closed 9 years ago

bjornblissing commented 9 years ago

Add support for the Oculus SDK based distortion rendering.

bjornblissing commented 9 years ago

An experimental branch is setup which tries to solve this. But as of yet is unsuccessful. Branch can be found here: http://github.com/bjornblissing/osgoculusviewer/tree/sdk-rendering

danjo133 commented 9 years ago

Hi, I'm trying to build your branch on Linux, and after some changes I have gotten it to build, but it crashes with a SIGSEGV giving this backtrace:

0 0x00000000004877b1 in OVR::SDKWindow::getVisualFromDrawable(unsigned long, XVisualInfo_) ()

1 0x0000000000459a3a in OVR::CAPI::GL::Context::InitFromCurrent() ()

2 0x0000000000456e24 in OVR::CAPI::GL::HSWDisplay::RenderInternal(ovrEyeType, ovrTexture const) ()

3 0x0000000000439a0a in ovrHmd_EndFrame ()

4 0x0000000000434929 in OculusDeviceSDK::endFrame (this=0x72f090)

Have you seen anything like it when trying to build?

bjornblissing commented 9 years ago

@danjo133 Yes, this is one of the errors I have come across while trying to get the SDK based rendering to work. There seem to be something wrong with the order the rendering contexts are being initialized from OSG contra what the SDK expects.

danjo133 commented 9 years ago

@bjornblissing Ok, good and bad news then..

I'll spend some time tomorrow looking in to it as well.

On another note, some windows specific things (HWND) has gotten into the interface for the SDK renderer, do you prefer to have ifdefs there or to move those things into the cpp-file? (If you're interested in my changes I can create a PR)

bjornblissing commented 9 years ago

@danjo133 If it is possible to keep the same function or at least similar functions, then I prefer the ifdef route.

I already use some #ifdef _WIN32 in the master branch regarding process priorities. I think the correct macro for Linux is #ifdef __linux__.

Feel free to send me a PR if you have something that compiles on Linux. Just try to keep the style of your code consistent with the rest of the project code.