Am I doing something wrong? DIY Rift mode not working?

The place for all discussion of the Oculus Rift compatible open source 3D drivers.
Post Reply
Croccy22
Cross Eyed!
Posts: 140
Joined: Wed Feb 04, 2009 7:51 am

Am I doing something wrong? DIY Rift mode not working?

Post by Croccy22 »

So I think i've read every thread going on here recently!!

I have just finished building my DIY Rift (Photos coming soon). But in the small amount of testing I have done so far I am getting problems with skew and aspect ratio.

I have my LCD controller board connected via DVI and it reports that it's native resolution in 1280x800. I have also set it at this resolution and told it not to scale (Think I read that somewhere).

If I launch Skyrim with the Vireio drivers (DIY Rift) and Shared Memory tracker (Using a Sparkfun 9DOF with AHRS Firmware and then FreePie with the VireioSMT Plugin), The game plays in stereo 3D with the warping but everything looks tall and thin and when I tilt my head everything gets skewed quite badly.

Have I missed something really obvious here? I have read so much it is quite possible I have not done the simplest things so any help would be appreciated.

Thanks, Matt.
Last edited by Croccy22 on Tue Jun 04, 2013 9:35 am, edited 1 time in total.
User avatar
RescueGamer
Cross Eyed!
Posts: 108
Joined: Thu May 16, 2013 1:02 am

Re: Am I doing something wrong?

Post by RescueGamer »

I don't know how to solve yor problem (i'm not sure if I understand it, some photos may help), but i'm insterested because i'm going to build a DIY Rift too (I want photos of your's).
Croccy22
Cross Eyed!
Posts: 140
Joined: Wed Feb 04, 2009 7:51 am

Re: Am I doing something wrong?

Post by Croccy22 »

Will take some photos and screenshots in a minute.

Have done some more experimenting today and it seems the issue is related to the DIY Rift mode only. If I set the driver to be in Oculus Rift mode then the graphics are in the correct aspect ratio and there is no Skew during head rolling. However this mode doesn't work well with DIY Rifts as it doesn't fill the screen so there is big black borders.

I have just tried setting the resolution in Skyrim to 1280x1024 and this is much better, it's almost perfect but not quite. When you roll your head there is still a small amount of skew visible.

Is anyone out there using this with a DIY Rift and has actually got it working? Not sure if I am doing something completely wrong or if it just hasn't been tested with DIY Rifts. My HMD is using the 5.6inch 1280x800 panel with the 5x aspheric lenses that were recommended by Palmer in the DIY Rift Thread.

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

Re: Am I doing something wrong?

Post by Croccy22 »

Just put skyrim into a custom resolution of 1280x1280 using the skyrimprefs.ini and now it is 99% perfect with hardly any skew at all.

Am I doing something stupid here? Why is the aspect ratio so far out when using DIY Rift mode?

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

Re: Am I doing something wrong?

Post by Croccy22 »

RescueGamer wrote:I don't know how to solve yor problem (i'm not sure if I understand it, some photos may help), but i'm insterested because i'm going to build a DIY Rift too (I want photos of your's).
Here are a couple of photos. It's not quite finished yet. I need to create a lid for the breakout box and have some tweeks I want to do to the HMD itself. But it all works and doesn't look too bad for a DIY job. This is only the 2nd thing I have designed myself with the 3D printer so think i've done ok :)

Image

Image

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

Re: Am I doing something wrong?

Post by Croccy22 »

I have tried taking some photos to show what I mean but they didn't turn out to well so prob wont help.

I have looked at videos people have posted on yourtube of Vireio working with a DIY Rift and they are not having the same problem as me so there must be a setting somewhere.

Basically I am seeing Half SBS when I run Skyrim with Vireio in DIY Rift Mode so everything is much taller than it is wide, this is throwing out the aspect ratio so that roll does not work without severe skew.

Any ideas?????

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

Re: Am I doing something wrong?

Post by RescueGamer »

guau, great design! What did you do for extend the lvds cable? I don't have a 3d printer, so i will use foam board to build the housing, i hope it works. I recived my lenses today, i'm waiting now for the display, when it arrives i will test it and say you my results ;)
ChrisJD
Cross Eyed!
Posts: 176
Joined: Mon Feb 25, 2013 10:29 pm
Location: NZ

Re: Am I doing something wrong?

Post by ChrisJD »

It's not a part of the code that I've looked at prior to about 5 minutes ago. It looks like the DIY Rift view is based on the Side-by-side with a warp on top.

The Rift view has it's own separate image combining and warp shader.

Tall and thin is what things look like without any warp in side by side. If you add a warp and get roll skew on top I'd guess the problem is with the DIY warp shader. But I've never tested roll in Side by side so it could be something in there. Does it skew if you just use SBS and roll the view?

You could try older/newer builds and see if they work any better. It's possible changes made to make the Rift work better have broken DIY support at some point. I don't know if it's ever been tested much and I doubt it has gotten much testing as development has continued (I hadn't even noticed that a separate DIY Rift mode existed).
Croccy22
Cross Eyed!
Posts: 140
Joined: Wed Feb 04, 2009 7:51 am

Re: Am I doing something wrong?

Post by Croccy22 »

I can't test it again at the moment as I broke one of the pins on my HDMI port but I am pretty sure I tried it in SBS mode and the problem was there too. I have looked at older version but the DIY Rift mode did not exist so it is something new that has been added. Which is a bit strange to add something that doesn't work?

The weird thing is I have seen you tube videos of people with DIY Rifts with Vireio working fine but they don't state what mode they used :(.

So close yet so far. I wonder if it is anything that can be easily fixed. As I said a temp almost workaround is to set the screen res in the game to 1280x1280 but I doubt that will work for all games.

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

Re: Am I doing something wrong? DIY Rift mode not working?

Post by Croccy22 »

OK,

So I have zero experience with shaders but I opened up the .fx file for the DIY Rift and radomly changed numbers to see what happened :)

I think I sort of understand what is going on (Anyone got a good guide so I can actually understand this properly?).

Anyway I have changed the code to this:

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 + 2.0f)*0.25f;
  newPos.y = (newPos.y + 1.0f)*0.5f;
  return newPos;
}

float4 SBSRift(float2 Tex : TEXCOORD0) : COLOR
{
	float4 tColor;
	float2 newPos = Tex;
	if(newPos.x < 0.5)
	{
		newPos.x = newPos.x * 2.0f;
		tColor = tex2D(TexMap0, Warp(newPos));	
	}
	else 
	{
		newPos.x = (newPos.x - 0.5f) * 2.0f;
		tColor = tex2D(TexMap1, Warp(newPos));
	}
	return tColor;
}

technique ViewShader
{
	pass P0
    {
		VertexShader = null;
        PixelShader  = compile ps_2_0 SBSRift();
    }
}
I now get a correct aspect ration image and the head rolling works perfect. Only problem is it cuts off the left and right side of the screen as expected. But I guess this is why the zoom function was put into the offical Rift Driver. Maybe I can figure out how to do the same thing for the DIY Rift Shader.

This is fun!! hehe

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

Re: Am I doing something wrong? DIY Rift mode not working?

Post by RescueGamer »

with that the image exceeds the display area, strange, i hope someone with skills on this can help us, because i notice too that the objects seems very tall with the diy rift
ChrisJD
Cross Eyed!
Posts: 176
Joined: Mon Feb 25, 2013 10:29 pm
Location: NZ

Re: Am I doing something wrong? DIY Rift mode not working?

Post by ChrisJD »

Ignoring any warping for now, what is the desired result?

Single view reference image:
Image


Maintaining aspect ratio of original and keeping whole image:
Image

Ignoring original aspect ratio and just squashing everything in (what SBS mode does):
Image

Maintaining original aspect ratio but cropping image to match halfscreen aspect ratio so you end up using the full screen area:
Image

Something else?
Croccy22
Cross Eyed!
Posts: 140
Joined: Wed Feb 04, 2009 7:51 am

Re: Am I doing something wrong? DIY Rift mode not working?

Post by Croccy22 »

I think it will depend on the game but to start off with I would say a mixture of cropping and full screen. So maybe sacrifice some of the vertical for for some more of the horizontal. Maybe fill 80% of the vertical and then crop the left and right evenly on the horizontal to keep the aspect ratio.

Matt.
ChrisJD
Cross Eyed!
Posts: 176
Joined: Mon Feb 25, 2013 10:29 pm
Location: NZ

Re: Am I doing something wrong? DIY Rift mode not working?

Post by ChrisJD »

Croccy22 wrote:I think it will depend on the game but to start off with I would say a mixture of cropping and full screen. So maybe sacrifice some of the vertical for for some more of the horizontal. Maybe fill 80% of the vertical and then crop the left and right evenly on the horizontal to keep the aspect ratio.
That's certainly doable. The Math part of my brain got as far as figuring out what is currently going on, then it shutdown for the day. I made some notes on what is actually happening in the shader if you want to try and work it out yourself.

Code: Select all

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

sampler2D TexMap0;   // Left input texture
sampler2D TexMap1;   // Right input texture

// Apply warp to texture coordinate look up
float2 Warp(float2 Tex : TEXCOORD0)		// Texture coordinate is in a 0.0 to 1.0 range in each direction
{
  float2 newPos = Tex;
  float c = -81.0f/10.0f;				// Distortion coefficient of some sort
  float u = Tex.x*2.0f - 1.0f;			// Texture coordinates converted to -1.0 to 1.0 range
  float v = Tex.y*2.0f - 1.0f;			
  newPos.x = c*u/(pow(v, 2) + c);		// Distortion
  newPos.y = c*v/(pow(u, 2) + c);		
  newPos.x = (newPos.x + 1.0f)*0.5f;	// Convert range back to 0.0 to 1.0 (roughly, more like -1/14 to +15/14) which is why you get the clamped
  newPos.y = (newPos.y + 1.0f)*0.5f;	// textures repeating to the edge where you're out of the texture coord range of 0.0 to 1.0
  return newPos;
}

float4 SBSRift(float2 Tex : TEXCOORD0) : COLOR	// Executed for every pixel on the screen. Tex is the normalised coordinate (0.0 to 1.0) of the pixel 
{
	float4 tColor;
	float2 newPos = Tex;
	if(newPos.x < 0.5)							// Pixel in the left half of the screen
	{
		newPos.x = newPos.x * 2.0f;				// Extend the x texture coordinate to cover the whole input texture, effectively maps full size image to left half of screen (squashed in x)
		tColor = tex2D(TexMap0, Warp(newPos));	// Sample the left image input using the warped texture coordinate
	}
	else										// Pixel in the right half of screen
	{
		newPos.x = (newPos.x - 0.5f) * 2.0f;	// Same as above, obviously different adjustment (map 0.5 to 1.0 range to 0.0 to 1.0 range instead of from the 0.0 to 0.5 range of the left side)
		tColor = tex2D(TexMap1, Warp(newPos));	
	}
	return tColor;
}

technique ViewShader
{
	pass P0
    {
		VertexShader = null;
        PixelShader  = compile ps_2_0 SBSRift();
    }
}
ChrisJD
Cross Eyed!
Posts: 176
Joined: Mon Feb 25, 2013 10:29 pm
Location: NZ

Re: Am I doing something wrong? DIY Rift mode not working?

Post by ChrisJD »

OK, I looked at it while properly awake, try the following (didn't test roll so it might be a problem, also it's a pain cropping the sides on a 16:9 monitor, couldn't see any of the menus in HL2):

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

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

Re: Am I doing something wrong? DIY Rift mode not working?

Post by Croccy22 »

Hi,

Had a couple of busy days so not had chance to test it yet. As soon as I do I will let you know the outcome. With regards to not being able to see all the screen I think it may be worth looking at the Oculus Rift shader as it has a variable for zoom. Maybe this could be used to allow the user to zoom in and out if they need to read the menus. I may have a look at this myself once I get a spare minute.

Thanks for taking your time to look at this :)

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

Re: Am I doing something wrong? DIY Rift mode not working?

Post by Croccy22 »

Quick update. Have tested the roll out now and it's working fine. Just need my HDMI ports to turn up so I can rebuild my LVDS/HDMI cable!. Why does everything take so long to turn up!!!! Grrrrrr

Matt.
ChrisJD
Cross Eyed!
Posts: 176
Joined: Mon Feb 25, 2013 10:29 pm
Location: NZ

Re: Am I doing something wrong? DIY Rift mode not working?

Post by ChrisJD »

In general with DIY Rifts are people always using the same lenses? Or at least the same type? Are they the same as / similar to the Rift lenses?

If they're the same shape/type (not sure on the correct terminology with regard to lenses) the distortion equation for the Rift would be the same for a DIY Rift, yes? (with different values for parameters)

If so it might make the most sense to expose the parameters of the equation in a cfg file so that appropriate values can be set for DIY Rift lenses. Then just have DIY and actual Rift using the same shaders (and add some features to said shader for people that want to play around with trading off the edges of the screen for more vertical).
Croccy22
Cross Eyed!
Posts: 140
Joined: Wed Feb 04, 2009 7:51 am

Re: Am I doing something wrong? DIY Rift mode not working?

Post by Croccy22 »

A lot of the diy rifts use the same 50mm aspheric lenses but there are some different ones too as people are experimenting to try and make them better. There is also the screen size issue which varies between 5.6inch and 7inch. Most diy ones use 5.6 but the actual rift now uses a 7 inch which has means the image centers have to be adjusted which has isn't a problem on a 5.6.

Im not sure how similar these lenses are to the original rift but I don't think they would be too different. In rift demos I have tried I would say the warping needed to be very weaker to get a perfect effect. Things seem to bulge out slightly at the moment. But i haven't noticed this on vireio yet. I will look a bit harder once it is running again.

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

Re: Am I doing something wrong? DIY Rift mode not working?

Post by RescueGamer »

Did you resolve the problem? I recived my 7" display today and with the 5x lenses that palmer suggested I noticed the problem you said, the image is to tall in DIY mode, and with the Oculus Rift mode the image doesn't fill all the screen, so if you have a solution tell me please. One thing, i noticed that with the minecrat hack for oculus rift (minecrift) the image is showed correctly, i hope this works. Waiting for solutions, and thanks for all your work!!
Croccy22
Cross Eyed!
Posts: 140
Joined: Wed Feb 04, 2009 7:51 am

Re: Am I doing something wrong? DIY Rift mode not working?

Post by Croccy22 »

Right, I have my DIY Rift working again now so have done some testing.

So far ChrisJD's script seems to work the best. The head roll and everything works fine and the aspect ratio is correct. There are small bars at the top and bottom but they do not distract from the gameplay at all.

You do lose the left and right sides of the screen but that is to be expected since we only have half the screen to play with. I think the best solution to this would be to have the option to scroll the viewable area from left to right using some shortcut keys (I think the Rift shader lets you do this too). At least that way if you needed to see a menu at the side of the screen it would allow you to view it still. Either that or have a zoom/in and out so you could zoom out for menus and then back in for gameplay.

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

Re: Am I doing something wrong? DIY Rift mode not working?

Post by RescueGamer »

You're right, we miss some things on the left and right, but I have to test it with the lenses. Like I said before the best would be something like the minecraft mod for the oculus rift, is there any way we can extract the numbers or ecuations used on the mod and put it on the DIY fx file?
One more thing, can you give me some measures from your DIY, like the distance from the display to the lenses or something like that?
Thanks!
User avatar
RescueGamer
Cross Eyed!
Posts: 108
Joined: Thu May 16, 2013 1:02 am

Re: Am I doing something wrong? DIY Rift mode not working?

Post by RescueGamer »

Sorry for the double post, but I found the ecuation that the minecrift team uses, but it's different, I will put here and hope someone know how to use it on the DIY fx file:

Code: Select all

#version 120

uniform sampler2D bgl_RenderTexture;

const vec2 LeftLensCenter = vec2(0.2863248, 0.5);
const vec2 RightLensCenter = vec2(0.7136753, 0.5);
const vec2 LeftScreenCenter = vec2(0.25, 0.5);
const vec2 RightScreenCenter = vec2(0.75, 0.5);
const vec2 Scale = vec2(0.1469278, 0.2350845);
const vec2 ScaleIn = vec2(4, 2.5);
const vec4 HmdWarpParam = vec4(1, 0.22, 0.24, 0);

// Scales input texture coordinates for distortion.
vec2 HmdWarp(vec2 in01, vec2 LensCenter)
{
   vec2 theta = (in01 - LensCenter) * ScaleIn; // Scales to [-1, 1]
   float rSq = theta.x * theta.x + theta.y * theta.y;
   vec2 rvector = theta * (HmdWarpParam.x + HmdWarpParam.y * rSq +
      HmdWarpParam.z * rSq * rSq +
      HmdWarpParam.w * rSq * rSq * rSq);
   return LensCenter + Scale * rvector;
}

void main()
{
   // The following two variables need to be set per eye
   vec2 LensCenter = gl_FragCoord.x < 640 ? LeftLensCenter : RightLensCenter;
   vec2 ScreenCenter = gl_FragCoord.x < 640 ? LeftScreenCenter : RightScreenCenter;

   vec2 oTexCoord = gl_TexCoord[0].xy;
   //vec2 oTexCoord = (gl_FragCoord.xy + vec2(0.5, 0.5)) / vec2(1280, 800);  //Uncomment if using BGE's built-in stereo rendering

   vec2 tc = HmdWarp(oTexCoord, LensCenter);
   if (any(bvec2(clamp(tc,ScreenCenter-vec2(0.25,0.5), ScreenCenter+vec2(0.25,0.5)) - tc)))
   {
      gl_FragColor = vec4(vec3(0.0), 1.0);
      return;
   }

   //tc.x = gl_FragCoord.x < 640 ? (2.0 * tc.x) : (2.0 * (tc.x - 0.5));  //Uncomment if using BGE's built-in stereo rendering
   gl_FragColor = texture2D(bgl_RenderTexture, tc);
}
Alesh
One Eyed Hopeful
Posts: 40
Joined: Sat Jun 22, 2013 2:46 am

Re: Am I doing something wrong? DIY Rift mode not working?

Post by Alesh »

I believe this solves our problem:

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/15.0f;  // value after / is how much warping (curvanture on top and bottom) higher value more 

warping
  float u = Tex.x*2.0f - 1.0f;
  float v = Tex.y*2.0f - 1.0f;
  newPos.x = c*u/(pow(v, 2) + c*1.2); // value after "+ c*" is  the multiplier for the v size of the screen
  newPos.y = c*v/(pow(u, 2) + c*1.2); // value after "+ c*" is  the multiplier for the u size of the screen
  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();
    }
}
Basically I added a 1.2 multiplier at the end of these lines:
newPos.x = c*u/(pow(v, 2) + c*1.2);
newPos.y = c*v/(pow(u, 2) + c*1.2);

This increases the size of each half of the screen and gets rid of annoying unused empty space at the top and bottom and effectively increases vertical FOV for my DIY rift. There is still a little bit of empty space so you can increase the 1.2 value even more, but for me it's a sweet spot since I don't notice it anymore. Looks much better and definitely adds to the immersion! As far as I'm concerned this solves my problem.

Does anyone know how to force FOV to 110 in Portal? I know how to do it in Portal 2 but not it Portal...
Croccy22
Cross Eyed!
Posts: 140
Joined: Wed Feb 04, 2009 7:51 am

Re: Am I doing something wrong? DIY Rift mode not working?

Post by Croccy22 »

The maximum for in portal is 90.

The reason why the black bars were at the top and bottom was because it gives us a larger horizontal view. If you zoom in you cut off more of the left and right.

There isn't a fix for this. It will never be perfect because we only have half of the screen to play with. You need to keep the aspect ratio so we can either have black bars top and bottom and see all the horizontal. Or cut down on the black bars and sacrifice some of the horizontal.

The only solution for this would be different lenses that would stretch the x axis by 2x. There is a thread that discusses fresnel lenses that may be able to achieve something like this.

Matt.
Alesh
One Eyed Hopeful
Posts: 40
Joined: Sat Jun 22, 2013 2:46 am

Re: Am I doing something wrong? DIY Rift mode not working?

Post by Alesh »

Croccy22 wrote:
The reason why the black bars were at the top and bottom was because it gives us a larger horizontal view. If you zoom in you cut off more of the left and right.

There isn't a fix for this. It will never be perfect because we only have half of the screen to play with. You need to keep the aspect ratio so we can either have black bars top and bottom and see all the horizontal. Or cut down on the black bars and sacrifice some of the horizontal.
Well I guess you win some , you loose some. I agree with the above, resizing the warp window gives you a narrower view, but that is something you can compensate with the Fov setting of 110. Not possible with Portal but works perfectly with Portal 2 with "cl_fov 110" command. This visually works much better for me than the black bars version. It increases the immersion and I can navigate through the game without any problems. So I guess this being an effective solution is a purely subjective opinion.
Post Reply

Return to “Development / General Discussion”