I'm waiting on parts for my own DIY Rift-alike HMD and in the mean time I was worried that I wouldn't have any software that I'm familiar with to test it out on when I finally put it together.
So I thought, why not get Quake Rift-ready? I hunted around for a good modern OpenGL source port to start from and found DarkPlaces: http://icculus.org/twilight/darkplaces/index.html
I haven't written any C code in a couple of years so it took me a little while to get oriented in the code, but after a little bit of hunting around I discovered that side-by-side stereo was already implemented. Unfortunately it looked like this:
![Image](http://i.imgur.com/ci5Pi7kh.jpg)
So I hacked around a bit and got full frame side-by-side stereo working. Then I worked out how to customise the shaders in the game and gave myself a quick crash course in GLSL before borrowing the pre-warp algorithm from Emerson's Biclops driver http://www.mtbs3d.com/phpBB/viewtopic.php?f=138&t=15086 thanks Emerson! It took a bit of modifying to get it playing nice with the odd way DarkPlaces was managing stereo rendering but I think I got it in the end. So now it looks like this:
(these are all cross-eyed images)
![Image](http://i.imgur.com/lxnKAEhh.jpg)
![Image](http://i.imgur.com/pnWWqLIh.jpg)
![Image](http://i.imgur.com/LHCleskh.jpg)
![Image](http://i.imgur.com/YS1FG55h.jpg)
![Image](http://i.imgur.com/bWkPvlOh.jpg)
Those are with cross-eye enabled for testing, I'd turn that off to run it on an actual HMD of course. Looks pretty good though?
I still have a lot of work to do to get everything cleaned up. The pre-warp will need to be modified to suit variable IPD and I'd like to work out how to do partial overlap. I'd also like to mask out the weird artifacts at the edge of the warp since it just looks wrong on the right hand side of each view and I think might be more distracting than a black mask. There's a bunch of codey things I need to do to tidy everything up, too.
And don't worry, I'm planning on improving the VR-ness of it as much as I can. I plan to implement 3DOF head tracking with a neck model and I'll try to get the head, body and gun all moving independantly. I have a Razer Hydra I'd like to integrate and for the time being I'll probably use an iPod Touch 4G for head tracking. I haven't thought about what to do about the HUD yet.
I have to double check the licensing on DarkPlaces, but as soon as I'm not ashamed of it I'll release binaries and (eventually, unless the license forces me to release them both together) source code.
![Smile :)](./images/smilies/icon_e_smile.gif)