(Working) Stereoscopic gaming with shutter glasses in Linux

Post Reply
mickeyjaw
Cross Eyed!
Posts: 131
Joined: Sun Feb 15, 2009 12:50 pm

(Working) Stereoscopic gaming with shutter glasses in Linux

Post by mickeyjaw »

I now have S-3D working in most normal (not quad-buffer supporting) games in linux with shutter glases and a normal (not quad-buffer supporting) GFX card

Ha! Bet you thought you would never see that!

Although i am using an NVIDIA card, this technique should work with any graphics card with OpenGL support and any DDC glasses. It should also be possible to create a parallel port to glasses dongle to work with this solution for those who want to use native DVI display solutions (think DLP projectors)

My setup:

3Ghz Pentium D
NVIDIA 7900GTX
E-dimensional Pass-thru Dongle + Elsa Revelator wired glasses
Ubuntu 8.04
NVIDIA Proprietary binary drivers
19" Dell M993 supporting 100hz refresh at 1024x768
Acco NOBO X20p DLP projector (bulb currently blown :( )

Software needed:
softgenlock-1.0.tar.gz from http://netjuggler.sourceforge.net/SoftG ... wnload.php" onclick="window.open(this.href);return false;
VRizer 0.5 - http://90.146.8.18/en/futurelab/project ... ctID=12290" onclick="window.open(this.href);return false; (download link dead, see attachment)
wine (should come with your distro)
E-D Activator (Windows version from E-D's website, should be named E-D.exe)

How to Setup SoftGenLock:
1) untar softgenlock:

tar xvf softgenlock-1.0.tar.gz

2) change into the softgenlock directory

3) edit the softgenlock Makefile, uncommenting the following lines:

USE_FLIP=_
USE_GLASSES=_

4) open sgen_param.h and find the line with #define HSIZE (1024 * 4)
change to suit the display resolution and colour depth you intend to run in stereo (width * (colour depth / 8)

5) in a console window, in the softgenlock directory type:

make user

6) Ignore everything the documentation says about compiling a kernel module - this only works on 2.4 series (very old) kernels

7) Ignore what the documentation says about it supporting DCC to activate the shutters - i could not get this to work either

8) If you are thinking of making the parallel cable described in the documentation, beware that the pinout described for a 3pin DIN plug in the docs is wrong.

9) Set your X display panning to twice the with of your display resolution e.g i use 2048x768 for a 1024x768@100hz display. NVidia users can do this with the nvidia-settings tool.

10) still in the softgenlock directory type sudo ./softgenlock (hit enter, need to have root access)

11) Your display should flicker then you should see both halves of the virtual desktop overlaid. Hit ctrl-C to end.



Setting up VRizer

1) Untar vrizer.

2) Edit the supplied vrizer.conf to suit your display resolution (supplied config presetup for 1024x768), config help in README.

NB the vrizer.conf is have supplied is setup for use with this technique, the one from ARS technica comes setup for anaglph.

3) Copy vrizer.conf to ~/.vrizerrc

4) Don't ask me for the source, i dont have it. The license allows redistribution of the binary though.


Getting it all to work

1) Disable compiz if it is running. Pick an app, say glxgears. If it is a normally fullscreen app, start it and set it to run in windowed mode then exit.

2) Open 2 terminal windows.

3) In the first terminal window, change to the directory where you saved E-D.exe from E-Dimensional and type:

wine ./E-D.exe &

4) The E-D activator widget should then appear on your GNOME panel. Click on it and select Page Flip. Click on it again and select Stereo - On/Resync. This only needs to be done once until the computer is switched off.

5) Back in the first terminal window, type:

export LD_PRELOAD=/wherever/you/untarred/vrizer/vrizer.so

replacing /whereever/you/untarred/vrizer with the path to the file vrizer.so

6) Launch your chosen app from the command line e.g.

glxgears

7) Confirm that your app draws two side by side views by panning the desktop left/right

8) In the second terminal window, change to the directory where you untarred softgenlock and type:

sudo ./softgenlock

9) To return sanity to your desktop, click on the terminal window running softgenlock, and hit ctrl-C


Please note that the system has no way of knowing which frame will be in sync with which eye. If you are having trouble seeing the 3D effect, try putting your glasses on upside down. If this fixes things, then either keep restarting softgenlock until it gets the sync the right way or edit ~/.vrizerrc and where it reads:

setup_eye 0 right
setup_eye 1 left

Change it to:

setup_eye 1 right
setup_eye 0 left

then restart the opengl app (from the LD_PRELOADed terminal window)
You do not have the required permissions to view the files attached to this post.
User avatar
yuriythebest
Petrif-Eyed
Posts: 2476
Joined: Mon Feb 04, 2008 12:35 pm
Location: Kiev, ukraine

Re: (Working) Stereoscopic gaming with shutter glasses in Linux

Post by yuriythebest »

congratulations mate! one for the history books! A true stereoscoper you are, kudos!
Oculus Rift / 3d Sucks - 2D FTW!!!
mickeyjaw
Cross Eyed!
Posts: 131
Joined: Sun Feb 15, 2009 12:50 pm

Re: (Working) Stereoscopic gaming with shutter glasses in Linux

Post by mickeyjaw »

So...

This thread has had a few reads now, has anyone successfully replicated my results yet?

Any feedback would be much appreciated.
User avatar
martinlandau
Certif-Eyed!
Posts: 653
Joined: Sat Mar 08, 2008 1:44 pm
Location: United States

Rube goldberg got nothing on you!

Post by martinlandau »

mickeyjaw wrote:This thread has had a few reads now, has anyone successfully replicated my results yet?
Marquis de sade has been reborn, I commend your efforts, and even though I run ubuntu I have sold my soul to MSFT regarding stereoscopy because I am lazy :( Why don't you contact that guy that makes ubuntu and get a job? If anyone is going to go replicate your efforts I would have thought it would be the most awesome Yuri.

One question I have, when running wine and this sterescopy solution, what kind of framerates do you get versus the same game running in native windows?
The futures so bright, I gotta wear shades!
http://www.youtube.com/watch?v=WDdI_sfNop8" onclick="window.open(this.href);return false;
Image
mickeyjaw
Cross Eyed!
Posts: 131
Joined: Sun Feb 15, 2009 12:50 pm

Re: (Working) Stereoscopic gaming with shutter glasses in Linux

Post by mickeyjaw »

martinlandau: As far as i can tell, this does not work with games run through wine, I only use wine to run the E-D activator.

here is a list of apps/games I have tried so far:


PlanetPenguinRacer - works all apart from background rendered 2D

Sauerbraten - works perfectly and is certainly one of the visually prettiest games i have tried. Almost every option including glow,
shaders etc seem to work.

Quiake 4 = sort of works, but with lots of shaders etc only drawn for one eye, kinda ruining the effect. I am currently experimenting with settings to try to fix this.

Google Earth - It is possible to tweak the eyedist/scale values in .vrizerrc to make it work for a particular level of zoom, but if you zoom in/out it messes up

All of the OpenGL screensavers (find them in /var/lib/xscreensaver in Ubuntu) seem to work pretty well too.

Supertuxkart - works perfectly

TORCS - also works

I have still to try Prey (Linux native client), as I have currently lent the game disc to a friend. I will report back soon though.

I have also tried running Worms 3D and Call of Duty 4 through Wine with this setup, but only one eye is rendered. To be honest, CoD4 runs crap (5-10fps) under wine anyway due to bugs in the shader support. These are the only M$ windows games I had to hand, so maybe others might work although i doubt it.

Maybe when I get some time i will prepare some benchmarks of Linux w/softgenlock and VRizer vs windows with Nvidia drivers. In this case i will test using Prey, Sauerbraten, PlanetPenguin Racer and Quake 4 as there are both native win32 and linux versions of all these games, but that is for anoter day...
User avatar
iondrive
Sharp Eyed Eagle!
Posts: 367
Joined: Tue Feb 10, 2009 8:13 pm

Re: (Working) Stereoscopic gaming with shutter glasses in Li

Post by iondrive »

hi guys,

I did a search for games that work stereoscopically under Linux and (re)found this thread. It's two years old now. How about an updated games list? Yes, I'm being lazy and not trying this myself yet. My mind is stuck in video-processing land :)

As an offshoot, what about games with native s3d support on Linux. TombRaider 1 can be used under windows with Glidos and it supports interlaced mode. Maybe it could work under Wine? Also there is an emulator for the old Virtual-boy that can run the games in interlaced mode too. I'll have to post a YouTube video of that someday even though it only has limited shades of gray/red for color. It's still neat. Teleroboxer is still a kind of unique game. Too bad Red Alarm works horribly with that emulator. What about Descent 1 and 2? Didn't they have interlaced mode in the source? What about Descent 3? The windows version could use either directx or opengl. It seems like the opengl version should work with this approach. Hmmm what else, Terminal Velocity had a patch for interlaced mode and I think Magic Carpet also. And High Octane. Let me check another web page for a sec... looking at http://en.wikipedia.org/wiki/List_of_st ... ideo_games" onclick="window.open(this.href);return false; (thank you phil) I don't see much else there other than Avatar. If you say some the games mentioned are too old to care about, I won't really argue with you except for Descent 3. It's still pretty unique. Oh yeah, Shattered steel has built-in interlaced 3d mode available but res is so low that it looks bad.

And another from another thread:
http://www.mtbs3d.com/phpBB/viewtopic.p ... c+3d+games" onclick="window.open(this.href);return false;
Trackmania Nations, that might work.

If anyone wants to try Tombraider 1 with glidos, I'll have to look up my notes on it in order to tell you how to change the 3d settings. The default settings are just awful IMO but I found good ones through some/much trial and error.

--- iondrive, out ---

What about just OpenGL games like Doom 3 and the older Quakes?
Also Starwars Knights of the Old Republic 1 or 2? (even though I don't really like those 2 yet)
Post Reply

Return to “General Stereoscopic 3D Discussion”