Page 1 of 1

Stereo driver for the Oculus Rift under Linux

Posted: Tue Sep 04, 2012 8:08 pm
by Fredz
I had to have a go at it, so here it is ! :) Based on my previous tests with anaglyph rendering I've started to modify my Linux stereo driver in order to make it compatible for the launch of the Oculus Rift.

For now there is no warping nor chromatic aberration correction but I intend to implement that quickly. It does more or less support several games already such as Neverball/Neverputt, Extreme Tux Racer and TORCS as well as demos like Quake 3 and Doom (with Vavoom).

The rendering should be "physically" correct for Quake 3 since I integrated the scale in my calculations (1 foot = 8 units), but it can be done for any game as long as I'm able to find the scale they use. I'm using a standard 65mm separation for now, but it's configurable in a config file.

The two frames are not rendered at the same time but I intend to correct that in the future by duplicating all drawing calls. I should also correct the sky rendering in Extreme Tux Racer and find a way to move the HUDs or to make them invisible (with an option and/or a shortcut key).

I intend to support games running through Wine such as Left4Dead, Supreme Snowboarding and PES2012 for which I have the demos installed.

Here are some screenshots, unfortunately I couldn't yet intercept the keyboard for Quake 3 and it only captured the left frame for Doom, so I can only show open source games for now :
screenshot_0.jpg
screenshot_5.jpg
etracer.jpg
I don't know if I'll make it open source yet. Steam is coming to Linux and that could be a good opportunity for me to make some money, by supporting future games with several stereo 3D modes (SBS, frame packing, anaglyph, interlaced and the Rift).

Re: Stereo driver for the Oculus Rift under Linux

Posted: Tue Sep 04, 2012 8:33 pm
by cybereality
Ah yes, great work.

I love all the development the Rift has spurred. Exciting times for sure.

Also, I got my warping equation from Emerson as per this post:
http://www.mtbs3d.com/phpBB/viewtopic.p ... 912#p74912

Re: Stereo driver for the Oculus Rift under Linux

Posted: Tue Sep 04, 2012 8:38 pm
by Fredz
Some more shots of Doom, since I recall someone asked for it in another thread :
screenshot_1.jpg
screenshot_2.jpg
Thanks Cyber, I'll have a look at these equations after some sleep and a good day of boring Web development at work... ;)

Re: Stereo driver for the Oculus Rift under Linux

Posted: Tue Sep 04, 2012 8:46 pm
by cybereality
Wow! DOOM!

Re: Stereo driver for the Oculus Rift under Linux

Posted: Tue Sep 04, 2012 9:34 pm
by android78
You need a disclaimer on that etracer.jpg pic... I was admiring the pics cross-eyed and that one almost made my eyes bleed with the way the hills in the background are rendered!

Re: Stereo driver for the Oculus Rift under Linux

Posted: Wed Sep 05, 2012 9:19 am
by Likay
Impressive work Fredz! I'm looking forward to see what's going to happen.

Re: Stereo driver for the Oculus Rift under Linux

Posted: Wed Sep 05, 2012 11:33 am
by Fredz
android78 wrote:You need a disclaimer on that etracer.jpg pic... I was admiring the pics cross-eyed and that one almost made my eyes bleed with the way the hills in the background are rendered!
Yep, sorry about that one, I'll correct the skybox rendering.

Thanks for the encouragements guys, appreciated. :)

Re: Stereo driver for the Oculus Rift under Linux

Posted: Thu Sep 13, 2012 2:15 pm
by cirk2
I'm just reporting in to state my interest in this. Quite impressive what you've done so far.

Is your driver working on a general principle (like the Nvidia or iz3D ones) or do you need to work it out for every Game?

Re: Stereo driver for the Oculus Rift under Linux

Posted: Thu Sep 13, 2012 3:28 pm
by Fredz
For now it's the same code base for all the games, but I may need to create profiles and specific coding paths for some games. I'm not able to support games through Wine at this point, so it's possible that Wine will be one of such paths. I'd need to implement some sort of log first to see what really happens behind the scenes though.

Re: Stereo driver for the Oculus Rift under Linux

Posted: Sat Sep 15, 2012 10:09 pm
by geekmaster
android78 wrote:You need a disclaimer on that etracer.jpg pic... I was admiring the pics cross-eyed and that one almost made my eyes bleed with the way the hills in the background are rendered!
The hills look great if viewed in wide-eye view, but the foreground is cross-eye view.

Re: Stereo driver for the Oculus Rift under Linux

Posted: Fri Sep 21, 2012 6:45 pm
by Fredz
A quick update to announce that I'm now able to support games through Wine. I've got Left4Dead, Supreme Snowboarding and PES 2013 demos more or less working. There are still some glitches like flickering and quad rendering instead of dual rendering for L4D and PES but it should be quite easy to correct.

I'm not able to get Deus Ex working for now since it doesn't seem to use double buffering, so I'll try another way by intercepting flush commands and/or viewport calls. No screenshots since I didn't backport my keyboard intercept yet, but that should be back soon.

So the next step is to try to have a single code base for all types of games, ie. native commercial 32bits, open source 32 and 64bits and Wine 32bits. When I'm satisfied with this I'll try to either write a configurable warping shader (IPD, magnifying value, chromatic abberation, overlap %) or support head tracking with the PS Eye and/or the devices I bought last week (Wiimote Remote Plus, PS Move).

Re: Stereo driver for the Oculus Rift under Linux

Posted: Fri Sep 21, 2012 8:38 pm
by cybereality
Cool.

Re: Stereo driver for the Oculus Rift under Linux

Posted: Tue Sep 25, 2012 11:34 am
by cirk2
Really nice! 3D is one of the last things that keeps Windows alive on my system (besides DX11).

Re: Stereo driver for the Oculus Rift under Linux

Posted: Wed Sep 26, 2012 9:52 am
by Bartdesign
Very nice work. I'm going to try this when i have my rift.

Re: Stereo driver for the Oculus Rift under Linux

Posted: Tue Mar 05, 2013 12:33 pm
by cirk2
Hey,
Is your project still alive? With the Steam for Linux Release this driver got more Relevant.

Re: Stereo driver for the Oculus Rift under Linux

Posted: Tue Mar 05, 2013 1:39 pm
by Fredz
I've not touched it for months, waiting for the Rift to regain motivation.

Re: Stereo driver for the Oculus Rift under Linux

Posted: Tue Oct 01, 2013 1:45 am
by Ziggurat
Fredz wrote:I've not touched it for months, waiting for the Rift to regain motivation.
Did you get your rift yet?
Now that SteamOS is announced it would be great.

Re: Stereo driver for the Oculus Rift under Linux

Posted: Wed Oct 02, 2013 12:52 pm
by Fredz
Yes I got my Rift but I've not resumed work on this project yet. I had a severe accident some months ago that got me somewhat sidetracked.

Re: Stereo driver for the Oculus Rift under Linux

Posted: Wed Oct 02, 2013 9:39 pm
by cybereality
I'm sorry to hear that. I hope everything turns out OK.

Re: Stereo driver for the Oculus Rift under Linux

Posted: Fri Oct 04, 2013 3:54 pm
by Fredz
Thanks Cyber, I'm mostly fine now.

Re: Stereo driver for the Oculus Rift under Linux

Posted: Tue Nov 12, 2013 12:12 am
by Mr_Bumpy
Fredz, I will be watching your driver with great interest. I already watch 3D videos under Linux using Bino or sView + my old-school shutter glasses, but I would love to be able to play games in 3D as well. Currently, I have to boot into Windows to do this, and I can't play my growing collection of OpenGL games this way.

Re: Stereo driver for the Oculus Rift under Linux

Posted: Tue Nov 12, 2013 2:33 pm
by Fredz
I've still not resumed programming on this driver and I'm not sure it'll fill your need.

At this time it only supports side-by-side, white/blue line code and anaglyph rendering and uses a frame alternate technique instead of rendering two views in one pass.

Support for 3D glasses that don't use WLC/BLC won't be easy, I had some code working for older DDC VGA glasses (eDimensional and Elsa Revelator) and older NVIDIA GPUs (<= NV50) but I did not integrate that in the driver.

Some code should be available for 3D Vision glasses support on Linux as well, I've bought a wired version of them but I didn't try to support that yet.

But the most difficult problem is to synchronize the rendering with the vertical retrace, I had some success with this by modifying Genlock but it did work only for 7XXX and 8XXX GPUs, was a bit cumbersome to install/activate (kernel module) and it didn't work for a lot of people it seems from the feedback I got.

So there is quite a lot of work to do before being able to support S3D rendering for shutter glasses on Linux.