Forum Discussion
MajortomVR
12 years agoHonored Guest
Irrlicht/Ogre - Rift integration
I am planning to do a bit of development for the rift since forever. I would love to make something using a free 3D Engine like Irrlicht. Problem is there are no tutorials out on how to integrate the Rift within Irrlicht or Ogre (with the lastest SDK using SDK rendering).
So my Question is: Is there someone out there that would be so awesome and write a basic hello world oculus rift app for irrlicht or/and ogre. Maybe simply by using the existing basic Hello World and adding just the rift with a few comments.
It doesn't even need to be Irrlicht or Ogre. It just should be somewhat easy to learn and run on Linux.
Thanks in advance!
Link to Irrlicht Example 1:
http://irrlicht.sourceforge.net/docu/example001.html
So my Question is: Is there someone out there that would be so awesome and write a basic hello world oculus rift app for irrlicht or/and ogre. Maybe simply by using the existing basic Hello World and adding just the rift with a few comments.
It doesn't even need to be Irrlicht or Ogre. It just should be somewhat easy to learn and run on Linux.
Thanks in advance!
Link to Irrlicht Example 1:
http://irrlicht.sourceforge.net/docu/example001.html
12 Replies
- YbalridExpert ProtegeHi,
I'm actually working on getting my game engine (wich use Ogre) running with LibOVR 0.3.2 using the SDK distortion solution.
I was using 0.2.5 but my code is a huge mess and I need to completely rewrite the class that handler communicating with the rift and who initialize the render.
When I'll get something that work I will post it here, for now I'm just getting data form the rift and printing it to a terminal...
If you want to try with LibOVR 0.2.5, you may found something that work on this thread : https://developer.oculusvr.com/forums/viewtopic.php?f=39&t=91 - cyberealityGrand ChampionI wrote a tutorial for getting head-tracking data here (just a command-line app, but could easily work with engines): https://developer.oculus.com/wiki/Minimal_Oculus_Application_0.3.x
I haven't got a chance to visit the SDK rendering stuff, and it seems a little more involved than it was in older SDK releases. - MajortomVRHonored GuestFirst, thanks for taking the time to answer guys!
I like that the SDK cares about getting the distortion and the rotation right, so we maybe don't need to worry about supporting every Rift. At least not on the rendering side.
So i am really looking forward to your solution Ybalrid!
In the meantime i think i am going to look into the old solution like you suggested and also start learning Ogre.
Also cyber, like you said, that 3D rendering stuff is actually over my head and i feel i need a something basic and simple, to get off the ground.
Thanks again, really appreciate the help! - YbalridExpert ProtegeSame, the SDK handeling for distortion is realy a good thing.
I just have to figure exactly how it works... ^^"
Reading throug the SDK Overview pdf, I understand that I have to render the tow camera to textures (with FOV parameters and size I get from the SDK), give the render textures to the SDK, give the viewports to the SDK and let it do everything else.
So, I still have to create the render window, viewports and evrything else the way I did before, Just, don't attach the cameras directly to the viewports...
Apparently it's api-dependent. But since I'm only using OpenGL Ogre Renderer (it run on both Linux and Windows) That should work (hoefully)
I still found that a little bit confusing. ^^" - I'll get back to ogre oculus stuff at some point, I just haven't had time and the new SDK is more complex to integrate in some ways.
Once I get my DK2 I'm sure I'll get something running. Probably using the new compositor in Ogre 2.0. - YbalridExpert ProtegeHi!
I finaly get something that works. Thanks to Gldk here :
http://www.ogre3d.org/forums/viewtopic.php?f=5&t=76970&sid=b850c5919ce94b03f0e2cdd225450364&start=125
It's a little bit quick and dirty :oops: But it runs.
For having the SDK Rendering proprely working with Ogre, some little changes have to be done on the CAPI_GL_DistortionRenderer.cpp of the OculusSDK.
You can find the stuff here : https://www.dropbox.com/s/j193dfvubivluwq/OgreOculusRenderer.tar.bz2
I have included the modified version of the SDK with the archive. If you want the detail of what have been change it's in the "modification" file at SDK root.
You may need to adjust the includes paths on the OgreOculusRender makefile, depending of your particular Ogre and GL installation.
I've included the binaries, so if you use Ogre 1.9 and have a 64bit Linux installation, you can try to run the "test" executable from the OgreOculusRender utility
Feel free to use and modify it! :-p - cyberealityGrand ChampionAwesome! Thanks for sharing.
- YbalridExpert ProtegeOne of the problems I had is that the distorded image was vertically flipped. I have no idea why. I use the solution you can see on the ogre forums. Apparently it's something to do whith the UV coordinates of the mesh for warping the texture on it.
Adding that line fliped again the image so it's in the correct orientation :eachEye[eyeNum].UVScaleOffset[0].y = -eachEye[eyeNum].UVScaleOffset[0].y;
But it feel strange having to do this. It does not seems to affect the "OculusWorldDemo" the Demo Scene of the configuration utility and the IPD measurement utility aren't affected by that change (image is still not flipped).
But the OpenGL example you can find here https://developer.oculusvr.com/forums/viewtopic.php?f=20&t=8680 is flipped. So if somebody have an idea why the image is reversed with ogre...
I will try to find out if I have time, but since I know almost nothing about OpenGL... :(
Maybe I will do a more *cleaner* way of doing that fix (add function before that enable the added fix, so it's a manual setting and does not affect programs that haven't that issue. Yes, I tend to do bad solutions for problems like that... :oops: )
If a dev at Oculus can take a look about it... Event if it looks like it's an Ogre specific problem, even since the textures are not flipped before being processed by the SDK
Also, the given code doesn't care about what is the running OS. I see that the ovrGlConfig struct is slightly different on Windows...
Anyway, it's fun. hopefully it will be working with the DK2, No idea how to figure the 90° screen orientation stuff. Will the SDK take care about it like for the distortion? Or it's just a matter of setting up the screen orientation on the graphics card settings? - MajortomVRHonored GuestHey Ybalrid!
I just wanted to say thank you for all your work and sharing it! I am just starting to get everything up and running, will look further into it. I think i should be able to get going from here, hopefully :)
I really appreciate your help! - YbalridExpert ProtegeI'm glad you like it.
I'm still trying to resolve the "flipped image" problem I have now.
I was wondering if Ogre was messing around the way the texture is coded (order of lines) or something while rendering. I write a stupid function (http://pastebin.com/raXxGxpy) that only use OpenGL to get the content of the texture to an image (ASCII PPM, since it's realy easy to construct the file by hand). and it looks ok :
And also, that change I made does flip the OgreOculusDemo, I just forgeten to recompile it -_-"
So something strange happend while the SDK is rendering, but apparently Ogre do render textures that are in the correct orientation.
No idea what's hapening here...
Quick Links
- Horizon Developer Support
- Quest User Forums
- Troubleshooting Forum for problems with a game or app
- Quest Support for problems with your device
Other Meta Support
Related Content
- 6 months ago
- 3 years ago
- 7 years ago