Page 1 of 1

Is it possible to adjust aspect ratio in Vireio?

Posted: Fri Apr 25, 2014 7:42 am
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.

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

Posted: Sat Apr 26, 2014 1:11 pm
by cybereality
It should be possible, but I don't think it will do it out of box.

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

Posted: Sat Apr 26, 2014 11:57 pm
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?

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

Posted: Sun Apr 27, 2014 11:59 am
by cybereality
Unfortunately, I'm not working on the software anymore.

You can try PMing Neil, as he's been managing the project.

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

Posted: Mon Apr 28, 2014 10:00 am
by Sikjar
OK, thanks - I might try that.

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

Posted: Sun May 18, 2014 8:06 am
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...

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

Posted: Sun May 18, 2014 12:30 pm
by cybereality
Thanks for posting the solution.