Best experiences with a DIY Rift and how to configure them

Talk about Head Mounted Displays (HMDs), augmented reality, wearable computing, controller hardware, haptic feedback, motion tracking, and related topics here!
Post Reply
Croccy22
Cross Eyed!
Posts: 140
Joined: Wed Feb 04, 2009 7:51 am

Best experiences with a DIY Rift and how to configure them

Post by Croccy22 »

Hi all,

I have completed my DIY Rift now so have started playing around with various games/demos to see what things look good etc. However since the Actual Rift is now released a lot of the things people are working on will only work with the official rift.

So what have people with DIY Rifts got working well? I thought it would be good to have a thread where people just post games/demos and what they did to get them to work and any limitations etc?

Matt.
Last edited by Croccy22 on Sun Jun 16, 2013 2:58 am, edited 1 time in total.
Croccy22
Cross Eyed!
Posts: 140
Joined: Wed Feb 04, 2009 7:51 am

Re: Best experiences with a DIY Rift

Post by Croccy22 »

I will start off with Half Life 2:

Requires:

Vireio Perception http://www.mtbs3d.com/phpBB/download/file.php?id=2721
FreePIE http://rapidshare.com/files/1743336024/ ... .277.0.msi
VireioSMT.DLL http://www.mtbs3d.com/phpBB/download/file.php?id=2233

Instructions:

*Extract Vireio Perception and place somewhere easy to access
*Install FreePIE
*Extract the VireioSMT.DLL file from the last download and place it in the FreePIE Plugins folder
*Open up the folder where Vireio Perception was extracted too. Go into the fx folder and edit SideBySide.fx in notepad
*Remove all the contents and replace with the following:

Code: Select all

// Combines two images into one warped Side-by-Side image

sampler2D TexMap0;
sampler2D TexMap1;

float2 Warp(float2 Tex : TEXCOORD0)
{
  float2 newPos = Tex;
  float c = -81.0f/10.0f;
  float u = Tex.x*2.0f - 1.0f;
  float v = Tex.y*2.0f - 1.0f;
  newPos.x = c*u/(pow(v, 2) + c);
  newPos.y = c*v/(pow(u, 2) + c);
  newPos.x = (newPos.x + 1.0f)*0.5f;
  newPos.y = (newPos.y + 1.0f)*0.5f;
  return newPos;
}

float4 SBSRift(float2 Tex : TEXCOORD0) : COLOR
{
   float4 tColor;
   float2 newPos = Tex;
   float2 warpedTexCoord;
   
   // This is all pretty lazy, I haven't generalised for a variable vertical percentage so it's fixed at 80%.
   //float screenRatio = 1.6f // 16:10 screen, use 1.777777777f for 16:9 screen
   //float visibleRatio = 1f; // 16:10 screen, use 0.9f for 16:9 screen. These numbers would need to change 
   // for a different vertical %. I've left all those calculations out
   // These numbers are constants for the screen size and a given vertical usage, so rather than calculating them for every pixel
   // I'm just putting the number directly into xRangeToUse. Normally this would be done outside the shader
   // and passed in.
   
   float xRangeToUse = 0.625f; //visibleRatio / screenRatio;
   float xHalfOfRangeNottoUse = 0.1875f; // (1f - xRangeToUse) * 0.5f;
   newPos.y = newPos.y * 1.25f - 0.125f; // 80% of vertical. 
      
   if(newPos.x < 0.5)
   {
      newPos.x = (newPos.x * 2.0f * xRangeToUse) + xHalfOfRangeNottoUse;
      warpedTexCoord = Warp(newPos);
      tColor = tex2D(TexMap0, warpedTexCoord);   
   }
   else 
   {
      newPos.x = (((newPos.x - 0.5f) * 2.0f)* xRangeToUse) + xHalfOfRangeNottoUse;
      warpedTexCoord = Warp(newPos);
      tColor = tex2D(TexMap1, warpedTexCoord);   
   }
   
   // remove everything between here and the next comment except "return tColor;" if you want the clamped texture around the edge instead of black
   if ((warpedTexCoord.y > 1.0f) || (warpedTexCoord.y < 0.0f)) {  
      return 0;
   }
   else {
      return tColor;
   }
   // This is the next comment
}

technique ViewShader
{
   pass P0
    {
      VertexShader = null;
        PixelShader  = compile ps_2_0 SBSRift();
    }
}
* Save the file.
*Now launch FreePIE and create a script to pass the yaw/pitch and roll of your tracking device to the VireoSMT Plugin. The script I use is below and is for the RazorAHRS but it can easily be modified for the other trackers. (If using RazorAHRS, remember to configure the com port using the plugins menu in FreePIE)

Code: Select all

def update():
   global yaw
   global roll
   global pitch
   
   yaw = ahrsImu.yaw
   roll = ahrsImu.roll
   pitch = ahrsImu.pitch
   
   vireioSMT.yaw = yaw - cyaw
   vireioSMT.roll = roll - croll
   vireioSMT.pitch = pitch - cpitch

   diagnostics.watch(yaw-cyaw)
   diagnostics.watch(roll-croll)
   diagnostics.watch(pitch-cpitch)
	
if starting:
   cyaw = 0
   croll = 0
   cpitch = 0
   ahrsImu.update += update

center = keyboard.getPressed(Key.Z)

if center:
   cyaw = yaw
   croll = roll
   cpitch = pitch
*Start the script running and check the debug to make sure you are getting sensible values (Sometimes I have to stop the script and re-run it for it to work). Pressing the Z key with my script will center all the values.
*Now luanch Vireio and then start Half Life 2 with the console (Add the -console switch to the command line to launch it)
*Once loaded, in the console type "sv_cheats 1" and press enter. Then "fov_desired 90" and press enter. Press the ` key to exit the console.
*Play the game and you should now have full head tracker with good FOV running in 3D on your DIY Rift :-).

Remember to use the Calibration tool built into Vireio to set the 3d up properly (Read this link: http://www.mtbs3d.com/index.php?option= ... &Itemid=77)

Known Problems:

The left and right sides of the screen are cut off to keep the aspect ratio. This mainly causes problems on the main menu as you cannot see the options. But these can easily be guessed and once in the game it doesn't really effect it that badly.

What comes next:

I am going to have a play around with the VR mod that was created for HL2 (Here: http://www.mtbs3d.com/phpBB/viewtopic.php?f=142&t=16174). Hopefully that will make it even better but not sure how well it will work with this setup.


I hope this is of some help to someone and if anyone else has experience with a DIY Rift and this game and has some better solutions then please let me know and I will update this guide. Also if anyone else has another guide for a different demo/game then please post below!

Matt.
User avatar
RescueGamer
Cross Eyed!
Posts: 108
Joined: Thu May 16, 2013 1:02 am

Re: Best experiences with a DIY Rift

Post by RescueGamer »

Mine is not finished, but I have been trying some games, with that congifuration I played Mirror's Edge (using de fov mod to expand the right and left sides) and works pretty well. I tried the virtual boy emulator and runs well too (this doesn't need head tracking). I tested some more, I will post it here later ;)
Croccy22
Cross Eyed!
Posts: 140
Joined: Wed Feb 04, 2009 7:51 am

Re: Best experiences with a DIY Rift and how to configure th

Post by Croccy22 »

Another one I have just had success with

Race Driver GRID

Requires:

Tri Def 3D (Ignition)
FreePIE
Race Driver GRID 1.2 Patch minimum (Needed for TrackIR Support)

Instructions:

*Install The TriDef Drivers (Demo version available)
*Install FreePIE
*Make sure TriDef has detected you have GRID Installed and has created a profile. If not then manually add the game.
*Launch FreePIE. I used the following very basic script (Will improve it at some point to have a center hot key, at the moment I coded in a fixed value to center the yaw, this will be different for you):

Code: Select all

yaw = ahrsImu.yaw
roll = ahrsImu.roll
pitch = ahrsImu.pitch
   
trackIR.yaw = yaw - 49
trackIR.roll = roll
trackIR.pitch = pitch

diagnostics.watch(yaw-49)
*As you can see my yaw needed a value of -49 to make it read 0 when I am looking straight ahead. To get this number, set it to zero, start the script and then look directly forward. Whatever the number reads in the debug window is what you need to subtract (Hope that makes sense). Also this script is designed to work with my AHRS Imu so you will need to change this for your tracker (See the FreePIE forums)
*Leave FreePIE running in the background
*Now we need to make some changes to GRID to get it to work properly. Go into the folder where GRID is installed and then go into the system folder. Edit the file called hardware_settings_restrictions.xml. Look down the file until you find the <!-- Aspect Ratio --> section. You will see some entries there already. Duplicate one of the entries and then change its value to "1:1". Save this file.
*Next open the file called hardware_settings_options.xml. Scroll down until you find <category name="aspect" >. Again duplicate one of the sections and change the option name to 1:1 and the resolution aspect to 1:1. Save the file.
*Next we need to create a new custom resolution for our monitor. I have done this with nVidia control panel but this should be possible with different graphics cards. Go into the resolution section in the control panel and create a custom resolution of 1280x640. To get this part to work you will probably need to set your display to output ONLY to your DIY Rift (If you have it duplicated or extended it won't work). Once you have tested the resolution you should be able to set it as the resolution for that screen. You should notice you now have bars at the top and bottom of your screen. Again you MUST have it set to only display on your DIY Rift.
*Now we get to launch GRID using the TriDef Ignition program. You need to set it to display in SBS Left/Right (Use num pad 0 to open the TriDef menu in game).
*Go into the video options and set your resolution as 1280x640 and your aspect ratio as 1:1. You will now need to restart the game.
*Play the game using the In Car view and you should now have a pretty good FOV in full 3D without any errors and full head tracking!! This works very well if you are using a PC steering wheel :).

Known Problems:

None? It seems to work perfect and all menu items are visible with no grpahical glitches :)

If I have missed anything then please let me know!

Matt.
Croccy22
Cross Eyed!
Posts: 140
Joined: Wed Feb 04, 2009 7:51 am

Re: Best experiences with a DIY Rift and how to configure th

Post by Croccy22 »

Have got Microsoft flight working perfectly now with full head tracking and 3d. It looks amazing! Made myself feel so sick by doing barrel rolls into the floor. Hehe

Will post instructions soon. But it basically uses Tridef, freepie and a custom resolution of 1080x1250 with scale g mode set to full screen in the nvidia driver.

Matt.
Croccy22
Cross Eyed!
Posts: 140
Joined: Wed Feb 04, 2009 7:51 am

Re: Best experiences with a DIY Rift and how to configure th

Post by Croccy22 »

Grand theft Auto 4 working now :-). Great fun driving around being able to look out the window etc.

Will do a quick guide if anyone is interested. I seem to be the only person using a DIY Rift :P

Matt.
jkirchel
One Eyed Hopeful
Posts: 1
Joined: Fri Dec 06, 2013 11:58 am

Re: Best experiences with a DIY Rift and how to configure th

Post by jkirchel »

No Matt you are not. I just built my Hackulus today. Yea I used Xmas as an excuse to buy all the hardware. I got a 5.6 inch screen, lenses, MPU6050, arduino nano and stole some coroplast from the side of the road. I mounted it to some welding goggles from harbor freight. Out the door it was 179 bucks with shipping included. Took the morning to build. I spend half the day trying to get freepie to see my arduino/mpu6050 and finally got some numbers out of it using the freeimu and the ahrsImu settings. They are not tracking right so I have some work to do tomorrow. I found this thread and it is going to be the first place I stop tomorrow to see if I can get the head tracker to work using your instructions. I will admit that I had to try the sbs videos on youtube (coaster and demos) and got distracted watching WWZ and Pacific Rim.

Thanks for posting this.

Let me know if you want to see images of my project.
dan18241
One Eyed Hopeful
Posts: 1
Joined: Thu Sep 11, 2014 10:48 am

Re: Best experiences with a DIY Rift and how to configure th

Post by dan18241 »

im needing some advice iv gone through the steps at the top of the page but im getting the error message no hardware on com 5 running the ahrs protocol im using the adafruit 9dof sensor with an arduino micro. im just getting in to electronics and programming and I am at a loss how to proceed. any help would be great and thank you for the info already posed its been invaluable :-)
blackone
One Eyed Hopeful
Posts: 3
Joined: Wed Aug 05, 2015 4:35 am

Re: Best experiences with a DIY Rift and how to configure th

Post by blackone »

Croccy22 wrote:Grand theft Auto 4 working now :-). Great fun driving around being able to look out the window etc.

Will do a quick guide if anyone is interested. I seem to be the only person using a DIY Rift :P

Matt.
Hey, have you done the guide at the end? Thanks for your suggestion, have been helpful!
deggial
One Eyed Hopeful
Posts: 26
Joined: Thu Jan 19, 2012 6:43 am
Contact:

Re: Best experiences with a DIY Rift and how to configure th

Post by deggial »

I am very curious about GRID. As far as I know, the cockpits of all Codemasters racing games (up too Dirt Rally) look like sh*t with Tridef. I am a fan of GRID in 3D, but I always used the hood camera. Any classified info I should know about the cockpits? :)

P.S.: - no, you're not the only one with DIY HMD

P.S.#2: - can we not call it "rift" anymore? I mean, I had started my HMD project about 10 years ago when Oculus Rift wasn't even a name. The tech was existent; Oculus was just speculated at the right time.

P.S.#3: How about a DIY HMD section in this forum, so we can post videos, findings, gear info and so on? There are lots of people trying to build HMD's right now and it would be a treasure to find everything in a single section instead of looking for threads everywhere.
JacobVR
One Eyed Hopeful
Posts: 21
Joined: Wed Feb 10, 2016 8:19 am
Contact:

Re: Best experiences with a DIY Rift and how to configure th

Post by JacobVR »

I love how you wrote this entire article without crediting Dodocase for the vr toolkit. Sure it's based on google cardboard, but it is not "Cardboard"..
Post Reply

Return to “General VR/AR Discussion”