iphone rift with Virieo, Intugame, Gagagu, and Zeiss VR One

Post Reply
SousaKing
One Eyed Hopeful
Posts: 8
Joined: Thu May 07, 2015 7:27 pm

iphone rift with Virieo, Intugame, Gagagu, and Zeiss VR One

Post by SousaKing »

I have recently been bitten by the VR bug and I have to share some things that I have learned. This started with my fascination with Google Cardboard. I immediately started hunting in the app store for vr apps and I ran across Gagagu Streamer to stream games from by pc to my iphone. It was hard to configure and didn't do much except put a non 3D sbs image on my iphone 6. Before too long I discovered Virieo Perception and a new app for streaming your games called Intugame. Intugame also had head tracking. I was able to get Skyrim going with Intugame and Virieo on my Google Cardboard but the image was too tall with either the sbs setting or DIYrift setting in Virieo. I then found a forum with some edits to the sidebysiderift.fx file in one of the virieo folders that made the image the correct aspect ratio but only showed 80% of the image so the sides were cut off. I didn't like that but I could see some potential here for creating my own iphone rift. I was able to change some numbers and fix the image significantly. I will share those settings at the end of my saga. I then bought a cheap plastic "google cardboard" called ritech II or iMax 3D with a head strap. That was not a good purchase. It gave me a clearer picture than the google cardboard with no distortion but the picture was so small in front of my face that I might as well have just been looking at my monitor. Field of view is super important when you're trying to get immersed into a game. So I hunted around and broke down and bought a Zeiss VR One. Wow. What a difference. It's comfortable and has a pretty great field of view and a much better picture than the google cardboard. Now back to the streaming software. After playing around with Gagagu Streamer and Intugame I found that Gagagu Streamer gave a much better picture at a higher frame rate than Intugame but had no head tracking. The developer is currently working on that. So I tried a few games with both streamers and It was just O.K. The frame rate was just too slow and I was really wishing that I could use a direct connection to my computer to get the frame rate up but I don't think that's possible right now. Then I made a discovery that made me feel like a real idiot. My iphone was connected to my router at 2.4 GHz instead of 5GHz. Once I changed that, the frame rate jumped up to a very playable level. I am so excited that I can play my games in immersive 3D on my phone! I know it's no Oculus Rift but it sure will do for now.

Here are my settings in the sidebysiderift.fx file in the fx folder in your Virieo folder. These settings are good for a Zeiss VR One but you can easily edit some numbers for your hmd:





// 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/15.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();
}
}



Near the top of that code you see the line "float c = -81.0f/15.0f;" If you change that "15" it will change the amount of distortion for the image.

Soon after that are the lines
newPos.x = c*u/(pow(v, 2) + c);
newPos.y = c*v/(pow(u, 2) + c);

You can add a multiplier after the last "c" to increase or reduce the overall image size.
For example:
newPos.x = c*u/(pow(v, 2) + c*2.0);
newPos.y = c*v/(pow(u, 2) + c*2.0);
This will double the image size filling up your screen but cutting out a significant amount of the image.

If you want to make the image smaller, you could do something like this:
newPos.x = c*u/(pow(v, 2) + c*0.75);
newPos.y = c*v/(pow(u, 2) + c*0.75);

I hope all of this information helps someone get their own iphone rift going! Good luck!
Last edited by SousaKing on Sat May 09, 2015 8:20 pm, edited 2 times in total.

User avatar
cybereality
3D Angel Eyes (Moderator)
Posts: 11394
Joined: Sat Apr 12, 2008 8:18 pm
Which stereoscopic 3D solution do you primarily use?: S-3D desktop monitor

Re: iphone rift with Virieo, Intugame, Gagagu, and Zeiss VR

Post by cybereality »

Cool. Also, be sure to use the "code" tags when posting code.

Elementarladung
One Eyed Hopeful
Posts: 4
Joined: Wed Jun 12, 2013 11:57 pm

Re: iphone rift with Virieo, Intugame, Gagagu, and Zeiss VR

Post by Elementarladung »

Hi,
there are now Head Tracking and positional tracking implemented on gagagu's streamer. The server and the opentrack plugin (for head and position tracking) are available on github https://github.com/gagagu

I have the problem to get both images (left and right) together (i guess it called "ipd"?). What i have to adjust to move the both images so that it will fit together on my vr glasses (color cross)?
Sry, i don't know how to describe it. English is not my native language.

Here are some videos of gagagus's server with head and positional tracking:
https://www.youtube.com/watch?v=wzRUE8RmJu4
https://www.youtube.com/watch?v=uuF4zIPjEgM

User avatar
cybereality
3D Angel Eyes (Moderator)
Posts: 11394
Joined: Sat Apr 12, 2008 8:18 pm
Which stereoscopic 3D solution do you primarily use?: S-3D desktop monitor

Re: iphone rift with Virieo, Intugame, Gagagu, and Zeiss VR

Post by cybereality »

Nice work.

Elementarladung
One Eyed Hopeful
Posts: 4
Joined: Wed Jun 12, 2013 11:57 pm

Re: iphone rift with Virieo, Intugame, Gagagu, and Zeiss VR

Post by Elementarladung »

Hi,
i have some problem by using vireio percetion but Left4Dead2 and my VR Streamer.

The first thing is that i have to move the reft an right images closer togehter (ipd). I`ve changed the SideBySideRift.fx to realize that because the normal menu idp setting ins not high enough.

Code: Select all

float4 SBSRift(float2 Tex : TEXCOORD0) : COLOR	// Executed for every pixel on the screen
{
	float4 tColor;
	float2 newPos = Tex;
	if(newPos.x < 0.5)							
	{
		newPos.x = newPos.x * 2.0f + 0.15f;		 // changed here		
		tColor = tex2D(TexMap0, Warp(newPos));	
	}
	else										
	{
		newPos.x = (newPos.x - 0.5f) * 2.0f - 0.15f;	// changed here
		tColor = tex2D(TexMap1, Warp(newPos));	
	}
	return tColor;
}
It seems to work and the view is much better than before. But i have an strange issue and i need some help to fix it. When i look to an object which is far away it looks sharp and good. When i will walk nearer to it, it will getting blurred. Which setting i have to tweek to solve it?

The second thing is i want to use headtracking. When i will activate "freetrack" as tracking source i will get the message on screen "hmd not initialized" and headtracking is not working. What i have to do to make it working?

Thanks forward for helping me.

trkh
One Eyed Hopeful
Posts: 2
Joined: Sat Jun 13, 2015 8:22 pm

Re: iphone rift with Virieo, Intugame, Gagagu, and Zeiss VR

Post by trkh »

Hey man I have this same fascination and my cardboard is coming in tommorow, my only problem is that currently intugame is lagging like crazy, how did you do the 5.4Ghz switch?

and is vireido the only way to make my games SBS? its very confusing to me. Why cant I just simply make all my games SBS with a simple program?

also do you have a skype or email where I can ask you some questions?

SousaKing
One Eyed Hopeful
Posts: 8
Joined: Thu May 07, 2015 7:27 pm

Re: iphone rift with Virieo, Intugame, Gagagu, and Zeiss VR

Post by SousaKing »

I have a dual band belkin router with 2.4Ghz and 5Ghz. I just connected to the 5Ghz channel with my iphone and it works great. I understand that iphone streams video better than android so it may not work as well with android. The other software that you can use to get SBS images is Tridef. There is a beta oculus setting that you can download but I have had trouble getting the image to look right with Tridef. I wish Vorpx would run without an oculus rift attached because that seems the most promising but it does not. Maybe one day...

SousaKing
One Eyed Hopeful
Posts: 8
Joined: Thu May 07, 2015 7:27 pm

Re: iphone rift with Virieo, Intugame, Gagagu, and Zeiss VR

Post by SousaKing »

By the way...Outlast was on sale on Steam for $4 and it is awesome in the iphone rift with Virieo!

trkh
One Eyed Hopeful
Posts: 2
Joined: Sat Jun 13, 2015 8:22 pm

Re: iphone rift with Virieo, Intugame, Gagagu, and Zeiss VR

Post by trkh »

SousaKing wrote:I have a dual band belkin router with 2.4Ghz and 5Ghz. I just connected to the 5Ghz channel with my iphone and it works great. I understand that iphone streams video better than android so it may not work as well with android. The other software that you can use to get SBS images is Tridef. There is a beta oculus setting that you can download but I have had trouble getting the image to look right with Tridef. I wish Vorpx would run without an oculus rift attached because that seems the most promising but it does not. Maybe one day...
I downloaded the TriDef program but it seems that it only has the option for SBS and not SBS 3D, how were you able to do SBS 3D? and the Dual Band thing is still confusing me but its not my priority. So how were you able to do SBS 3D with Tri Def

SousaKing
One Eyed Hopeful
Posts: 8
Joined: Thu May 07, 2015 7:27 pm

Re: iphone rift with Virieo, Intugame, Gagagu, and Zeiss VR

Post by SousaKing »

trkh wrote:
SousaKing wrote:I have a dual band belkin router with 2.4Ghz and 5Ghz. I just connected to the 5Ghz channel with my iphone and it works great. I understand that iphone streams video better than android so it may not work as well with android. The other software that you can use to get SBS images is Tridef. There is a beta oculus setting that you can download but I have had trouble getting the image to look right with Tridef. I wish Vorpx would run without an oculus rift attached because that seems the most promising but it does not. Maybe one day...
I downloaded the TriDef program but it seems that it only has the option for SBS and not SBS 3D, how were you able to do SBS 3D? and the Dual Band thing is still confusing me but its not my priority. So how were you able to do SBS 3D with Tri Def
You can set your monitor resolution to 1920X2160 and run your game in a 1920X1080 window with Tridef SBS mode on and you will have a 3d image in your google cardboard.

Post Reply

Return to “Config & Shader Profiles”