Is it possible to adjust aspect ratio in Vireio?

The place for all discussion of the Oculus Rift compatible open source 3D drivers.
Post Reply
Sikjar
One Eyed Hopeful
Posts: 4
Joined: Sat Sep 14, 2013 11:04 am

Is it possible to adjust aspect ratio in Vireio?

Post by Sikjar »

I've got this idea about using a curved mirror to create a DIY HMD with a large horizontal FOV and small vertical FOV.
Basically the idea is to use the mirror to stretch a 16:9 LCD to something like 25:9.
But then I will also need to adjust the aspect ratio that Vireio outputs.
Does anybody know if this is possible?

The below quoted post seems to indicate so, but I haven't been able to find any more information...
I would like an output that looks like image no. 2.
Valez wrote:There doesn't seem to be a solution:
ChrisJD wrote:
Valez wrote:Well, then let's eliminate that absence.
Sorry, that was the short, I'm heading off answer, it wasn't clear.

The eyes get rendered at the full screen resolution (more importantly, at the full screen aspect ratio). When you put that image into half the screen you get something like this (All screen shots are without distortion for clarity).

Image

The big black borders are there because there is nothing to put there (while maintaining the aspect ratio).

There are various ways to try and address this. Ignore the aspect ratio and stretch to the area, terrible idea.
Image

Zoom the image in and lose the edges of the view. Better, but it creates more problems than you might think. You have to be able to bump the fov way up (additional distortion issues) to get the correct fov instead of the narrow zoomed fov you see here. This means rendering a lot more geometry that never gets seen.
Image

In some games we might be able to get away with reprojecting using the correct aspect ratio for the side. However, this doesn't work in general because the game has already culled geometry outside of the projection the game is using so we get geometry popping in and out. imo that's worse than black borders.
User avatar
cybereality
3D Angel Eyes (Moderator)
Posts: 11407
Joined: Sat Apr 12, 2008 8:18 pm

Re: Is it possible to adjust aspect ratio in Vireio?

Post by cybereality »

It should be possible, but I don't think it will do it out of box.
Sikjar
One Eyed Hopeful
Posts: 4
Joined: Sat Sep 14, 2013 11:04 am

Re: Is it possible to adjust aspect ratio in Vireio?

Post by Sikjar »

Yes, I've been tampering a bit with the configuration files, in config.xml there's a value called aspect_multiplier="1", but changing it doesn't seem to have any effect.

I don't have the skills to edit the source code in order to change the aspect ration.

Can an option to adjust aspect ration be added to some sort of wish list for future versions of Vireio?
User avatar
cybereality
3D Angel Eyes (Moderator)
Posts: 11407
Joined: Sat Apr 12, 2008 8:18 pm

Re: Is it possible to adjust aspect ratio in Vireio?

Post by cybereality »

Unfortunately, I'm not working on the software anymore.

You can try PMing Neil, as he's been managing the project.
Sikjar
One Eyed Hopeful
Posts: 4
Joined: Sat Sep 14, 2013 11:04 am

Re: Is it possible to adjust aspect ratio in Vireio?

Post by Sikjar »

OK, thanks - I might try that.
Sikjar
One Eyed Hopeful
Posts: 4
Joined: Sat Sep 14, 2013 11:04 am

Re: Is it possible to adjust aspect ratio in Vireio?

Post by Sikjar »

Just a quick update:

It seems that aspect ratio can be adjusted by changing some parameters in the .fx files found in the folder perception2_0_0_2\perception\fx

This can be achieved by changing the following lines in the configuration SideBySideRift.fx:

float c = -81.0f/20.0f; // Distortion coefficient of some sort -81.0f/10.0f;
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);

into this

float c = -162.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 = 0.5*c*v/(pow(u, 2) + c);

And selecting the profile DIY Rift in Vireio Perception.

Now I just have to try and build that HMD I've been planning...
User avatar
cybereality
3D Angel Eyes (Moderator)
Posts: 11407
Joined: Sat Apr 12, 2008 8:18 pm

Re: Is it possible to adjust aspect ratio in Vireio?

Post by cybereality »

Thanks for posting the solution.
Post Reply

Return to “Development / General Discussion”