Skip to main content
kojack
Honored Contributor
March 30, 2013

Ogre3D Integration

I grabbed the Oculus sdk earlier today and have been working on a sample of using it with the open source 3d engine Ogre3D.

I've got the rendering working fairly well and I wrote a parser to load the tuscany scene from the sdk. Head tracking is almost implemented.

Since I don't have an actual oculus rift, I'll give out a test version soon to see if it works for anyone else.

http://www.ogre3d.org/forums/viewtopic.php?f=5&t=76970



Edited in Latest Status:
06/04/2013
Source (MIT licensed) released at https://bitbucket.org/rajetic/ogreoculus

08/04/2013
Latest binary demo: https://bitbucket.org/rajetic/ogreoculus/downloads/OgreOculusDemo1_v0.5.1.7z

    38 replies

    kojack
    kojackAuthor
    Honored Contributor
    June 19, 2013
    Yesterday I finally got to see my demo running on a real rift, only 2.5 months after I wrote it. :)

    Unfortunately, it's not my rift, it belongs to one of my students. So I only got to play with it for a few hours, plus I was actually working during that time so most of that was spent helping final project students with recast nav meshes, tracking down network bugs, animation exporting and other stuff I'm actually being paid to do.

    So now I'm back to not having a rift (until aus 48xxx orders are shipped). My ogre stuff isn't dead, it's just on hold until I have my own rift.
    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
    Inspiring
    June 19, 2013
    Great news!
    AMD Ryzen 7 1800X | MSI X370 Titanium | G.Skill 16GB DDR4 3200 | EVGA SuperNOVA 1000 | Corsair Hydro H110i Gigabyte RX Vega 64 x2 | Samsung 960 Evo M.2 500GB | Seagate FireCuda SSHD 2TB | Phanteks ENTHOO EVOLV
    Up and Coming
    July 7, 2013
    Are you the same KoJack working on oculus for openMW project?
    Morrowind with oculus would be so amazing. Thanks for all the hard work.
    DK1 Order #: 48xxx. Status: DK1 Owner since March 29th, 2013. DK2 Order #: DO-0154xxxx. Status: DK2 Owner since July 28th, 2014 My Stygian Abyss Demo Remake Blog http://mrob76u.wordpress.com
    kojack
    kojackAuthor
    Honored Contributor
    July 7, 2013
    "Mrob76o" wrote:
    Are you the same KoJack working on oculus for openMW project?
    Morrowind with oculus would be so amazing. Thanks for all the hard work.


    I saw a thread on the openmw forum mentioning my oculus code, but they haven't spoken directly to me yet. (I did have the lead of another game talk to me, but they aren't ready for rift integration yet and I still don't have my rift)

    OpenMW would be pretty cool on a rift.
    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
    July 7, 2013
    Ah I see. Must be the same thread I read. I hope the openMW guys get in touch with you. It's a game I have owned since it came out but barely played. Spent too much time modding it. I'm actually glad now. If it does get rift support then I can experience it the best way possible.

    Still waiting for my rift too. I'm also working on a personal project in unity and its a bit of a guessing game as to what it's actually going to look like when I get my rift. I'm sure I will need to adjust loads of stuff like the HUD and the scale of hand held objects. Looking forward too it.
    DK1 Order #: 48xxx. Status: DK1 Owner since March 29th, 2013. DK2 Order #: DO-0154xxxx. Status: DK2 Owner since July 28th, 2014 My Stygian Abyss Demo Remake Blog http://mrob76u.wordpress.com
    Inspiring
    August 5, 2013
    Kojack you've done a great job here ^^"

    I was playing around with Ogre and your OgreOculus Class and there was an issue : since the head orientation and the direction where you walk are separated (this is a GREAT thing because in the "real" reality you can walk and look at diferent direction, you have to be able to do the same in virtual reality :P) we can see the rift accumulate error mesuring the yaw angle.

    So I just added the automatic magnetometer calibration code from the SDK documentation into the class, tune down the threshold (by default, you can specify whatever you want) a little bit and it works well.

    I've forked your bitbucket repo, just for push the little change somewhere on the internet. I'm new to mercurial & bitbucket so I dont know how I can submit my changes to you. So there is the repo https://bitbucket.org/ybalrid/ogreoculus
    CV1+Touch; Running on GTX980 - 4770K - 32GB DDR3 Developer at LIV
    New Participant
    September 16, 2013
    that's indeed a great project and i added a little something too: pressing F1 to toggle between the rift display , and a desktop display ( single view , no warp )

    two little things (i'm a beginner in cpp :D ) :
    1) i was unable to compile with everything related to m_sensorFusion
    ( says it has no member SetMagReference , is it a namespace error ?? )

    2) i tried to add a third viewport with many problems ( crashes with " OGRE EXCEPTION(3:RenderingAPIException):Unable to create AA render target: Ran out of memory) ";
    i think Ogre might not be the most easy to use engine of all times and i would'nt recommend it for other beginners ...

    (removed url : outdated)
    Inspiring
    September 16, 2013
    Hi,

    In fact this code works with an old version of the oculus SDK, I've done some changes I still have to push to my repo, I do that as soon as posible ^^".

    The idea of toggleing between rift and normal display is great, I will certainly add your patch after reading it :p

    For your third viewoirt problem, I don't realy undrestand, what are you trying to do with 3 viewport ?

    I'm not realy a beginner in C++ but I'm certainly one with Ogre ^^"
    It's not the most simple to use but it's seems to be pretty powerful. Maybe you will found Irrlicht simpler, I see a topic here with guys implementing a rift support for it. It wasn't finished when I tried it and I dont checked it. I know the way Irrlicht handle (or NOT handle...) camera rotation is complicated. You will have to play with the direction of the camera up vector to match the rift orientation... (some maths to do for that)


    PS : can you do a diff between my code and your's ? I don't see and I dont have the time right now to search where you have done changes ^^"
    CV1+Touch; Running on GTX980 - 4770K - 32GB DDR3 Developer at LIV
    New Participant
    September 16, 2013
    Hi! personally not in rush, so plz do not feel any need to hurry for me ^^' many thanks for updating these important methods
    Ogre is indeed very powerful , even tough if too difficult i might look into Irrlicht indeed

    a diff is coming asap; basically, change is just Oculus::ToggleDualScreen() in OgreOculus.cpp, called from the while loop of main.cpp ( also added a viewport variable for the loops , but i'm unsure this would be of use)
    very happy you find it useful ^^ this idea of a rift/desktop view toggle comes from the tuscanny sdk samples

    as for a third viewport, maybe adding a third vp might be interesting for having a non-deformed view on desktop, while still having the stereo view on the rift.. not working on this feature right now tough, gotta understand shaders/viewports a bit more ^^
    Inspiring
    October 5, 2013
    Hi !

    Ok, I forget to push my code... I have some optimizations to do so I will do push it later.

    So, I dont have a lot of time to work on it now, I'm a 2nd year studend on a computer science specialized "Grande École d'ingénieur" ('great school of Engineering" in french, don't know how to translate it) and I have a LOT of work crushing me just now (it will just calm down in a few weeks, right now it's time of preparing and presenting several kind of projects you have to do, so I spend nights writing reports of all kind...) BUT I talked with one of my teacher and for my year project I will develop some fun stuff with the Rift so I will have time to work on it ! (and maybe budget for a Virtuix Omni...) xD

    However, I will push this code tomorow if I can.

    In fact, I dont use bitbucket for my main work, I use github to host my opensource stufs, I'm workin' on a *relatively simple* game engine using Ogre, and I use a modified version of this class on that project. (link : https://github.com/Ybalrid/Annwvyn), so you can find a better version in it.

    And it will work under Windows AND GNU/Linux.

    'Annwvyn' (the engine) is not usefull yet. If I can made something interesting with it I will open another topic to present it, so far, ils just me playng with Ogre, Bullet, OpenAL and stuffs.

    For the 3rd viewport stuff, It's interesting, but not usefull for now, in fact, when you play with the rift, you just dont care if there is (or not) non-deformed rendering on your computer screen. And in fact, the majority of people who use the rift actualy clone there desktop screen, so you cant display your third viewport on it. Also, I don't think it's interesting for another person to see somebody playing with a rift. So the non-deformed view isn't realy usefull...
    CV1+Touch; Running on GTX980 - 4770K - 32GB DDR3 Developer at LIV