Stereo driver for the Oculus Rift under Linux

Tutorials on how to create your own rigs, pics, movies, and everything that has to do with S-3D at home!
Post Reply
User avatar
Fredz
Petrif-Eyed
Posts: 2255
Joined: Sat Jan 09, 2010 2:06 pm
Location: Perpignan, France
Contact:

Stereo driver for the Oculus Rift under Linux

Post 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).
You do not have the required permissions to view the files attached to this post.
User avatar
cybereality
3D Angel Eyes (Moderator)
Posts: 11407
Joined: Sat Apr 12, 2008 8:18 pm

Re: Stereo driver for the Oculus Rift under Linux

Post 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
User avatar
Fredz
Petrif-Eyed
Posts: 2255
Joined: Sat Jan 09, 2010 2:06 pm
Location: Perpignan, France
Contact:

Re: Stereo driver for the Oculus Rift under Linux

Post 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... ;)
You do not have the required permissions to view the files attached to this post.
User avatar
cybereality
3D Angel Eyes (Moderator)
Posts: 11407
Joined: Sat Apr 12, 2008 8:18 pm

Re: Stereo driver for the Oculus Rift under Linux

Post by cybereality »

Wow! DOOM!
User avatar
android78
Certif-Eyable!
Posts: 990
Joined: Sat Dec 22, 2007 3:38 am

Re: Stereo driver for the Oculus Rift under Linux

Post 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!
User avatar
Likay
Petrif-Eyed
Posts: 2913
Joined: Sat Apr 07, 2007 4:34 pm
Location: Sweden

Re: Stereo driver for the Oculus Rift under Linux

Post by Likay »

Impressive work Fredz! I'm looking forward to see what's going to happen.
Mb: Asus P5W DH Deluxe
Cpu: C2D E6600
Gb: Nvidia 7900GT + 8800GTX
3D:100" passive projector polarized setup + 22" IZ3D
Image
User avatar
Fredz
Petrif-Eyed
Posts: 2255
Joined: Sat Jan 09, 2010 2:06 pm
Location: Perpignan, France
Contact:

Re: Stereo driver for the Oculus Rift under Linux

Post 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. :)
User avatar
cirk2
Certif-Eyed!
Posts: 521
Joined: Fri May 11, 2007 10:13 am

Re: Stereo driver for the Oculus Rift under Linux

Post 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?
Image
User avatar
Fredz
Petrif-Eyed
Posts: 2255
Joined: Sat Jan 09, 2010 2:06 pm
Location: Perpignan, France
Contact:

Re: Stereo driver for the Oculus Rift under Linux

Post 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.
geekmaster
Petrif-Eyed
Posts: 2708
Joined: Sat Sep 01, 2012 10:47 pm

Re: Stereo driver for the Oculus Rift under Linux

Post 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.
User avatar
Fredz
Petrif-Eyed
Posts: 2255
Joined: Sat Jan 09, 2010 2:06 pm
Location: Perpignan, France
Contact:

Re: Stereo driver for the Oculus Rift under Linux

Post 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).
User avatar
cybereality
3D Angel Eyes (Moderator)
Posts: 11407
Joined: Sat Apr 12, 2008 8:18 pm

Re: Stereo driver for the Oculus Rift under Linux

Post by cybereality »

Cool.
User avatar
cirk2
Certif-Eyed!
Posts: 521
Joined: Fri May 11, 2007 10:13 am

Re: Stereo driver for the Oculus Rift under Linux

Post by cirk2 »

Really nice! 3D is one of the last things that keeps Windows alive on my system (besides DX11).
Image
Bartdesign
One Eyed Hopeful
Posts: 11
Joined: Sat Dec 15, 2007 11:06 am
Location: The netherlands

Re: Stereo driver for the Oculus Rift under Linux

Post by Bartdesign »

Very nice work. I'm going to try this when i have my rift.
User avatar
cirk2
Certif-Eyed!
Posts: 521
Joined: Fri May 11, 2007 10:13 am

Re: Stereo driver for the Oculus Rift under Linux

Post by cirk2 »

Hey,
Is your project still alive? With the Steam for Linux Release this driver got more Relevant.
Image
User avatar
Fredz
Petrif-Eyed
Posts: 2255
Joined: Sat Jan 09, 2010 2:06 pm
Location: Perpignan, France
Contact:

Re: Stereo driver for the Oculus Rift under Linux

Post by Fredz »

I've not touched it for months, waiting for the Rift to regain motivation.
Ziggurat
Cross Eyed!
Posts: 189
Joined: Fri May 03, 2013 12:48 am

Re: Stereo driver for the Oculus Rift under Linux

Post 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.
User avatar
Fredz
Petrif-Eyed
Posts: 2255
Joined: Sat Jan 09, 2010 2:06 pm
Location: Perpignan, France
Contact:

Re: Stereo driver for the Oculus Rift under Linux

Post 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.
User avatar
cybereality
3D Angel Eyes (Moderator)
Posts: 11407
Joined: Sat Apr 12, 2008 8:18 pm

Re: Stereo driver for the Oculus Rift under Linux

Post by cybereality »

I'm sorry to hear that. I hope everything turns out OK.
User avatar
Fredz
Petrif-Eyed
Posts: 2255
Joined: Sat Jan 09, 2010 2:06 pm
Location: Perpignan, France
Contact:

Re: Stereo driver for the Oculus Rift under Linux

Post by Fredz »

Thanks Cyber, I'm mostly fine now.
Mr_Bumpy
One Eyed Hopeful
Posts: 4
Joined: Sat Dec 22, 2007 3:38 am
Location: Madison, WI, USA
Contact:

Re: Stereo driver for the Oculus Rift under Linux

Post 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.
User avatar
Fredz
Petrif-Eyed
Posts: 2255
Joined: Sat Jan 09, 2010 2:06 pm
Location: Perpignan, France
Contact:

Re: Stereo driver for the Oculus Rift under Linux

Post 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.
Post Reply

Return to “Do it Yourself!”