5dof support for TrackIR and improved 6dof for VR

A Forum dedicated to the Suggestion, Creation and Editing of XWA Dynamic Link Library Files

Moderators: Darksaber, General_Trageton, Forceflow, DTM, JeremyaFr

Re: 5dof support for TrackIR and improved 6dof for VR

kennj7132
Cadet 4th Class
Posts: 13
Joined: Mon Jan 27, 2020 10:56 pm

Post by kennj7132 » Sun Feb 02, 2020 7:25 am

I have inputed all the config changes Trevor suggested and I have setup the resand fov etc in xwahacker exactly as you described. Which part is the overscan you mention? Should I try the original config with the just the xwahacker changes?

User avatar
keiranhalcyon7
Lieutenant JG
Posts: 524
Joined: Tue Jan 02, 2018 6:41 am

Post by keiranhalcyon7 » Sun Feb 02, 2020 8:35 am

1) Please post a screenshot
2) (speculation) In xwahacker, try something like FOV = 140, with all the other settings the same. If that helps with the stretching, tinker with it until it looks right to you.

kennj7132
Cadet 4th Class
Posts: 13
Joined: Mon Jan 27, 2020 10:56 pm

Post by kennj7132 » Sun Feb 02, 2020 12:48 pm

Fresh install, followed Trevor settings again and used 640x720 fov 121 seems perfect for looking left and right (no stretching) but up and down is still doing it. The 151.93 fov is miles out in each direction in comparison.

So surely its the hex bit. How can I do that with changes to patcher. Xml as mentioned previously? Can't find the file so assuming I have to do something else to get it. I have made a video but it doesn't show it as clearly as wearing the rift.

User avatar
keiranhalcyon7
Lieutenant JG
Posts: 524
Joined: Tue Jan 02, 2018 6:41 am

Post by keiranhalcyon7 » Sun Feb 02, 2020 5:28 pm

It's not the "hex bit". As I wrote earlier, setting FOV to 152 in xwahacker does exactly the same thing. (Meaning, if you were to open the exe in a hex editor and go to that address, you'd find that the value is already set exactly as Trevor instructed.) But if you have a different FOV value that you like for the horizontal, keep it. We just have to figure out what's going on with the vertical, which sounds like an aspect ratio mismatch to me.

Blue_max, what does 3d_aspect_ratio = 0.800 do?

Kennj7132, since 640x720 has an actual aspect ratio of 8:9, could you try using 0.8888 for that setting in the file and see if it helps?

kennj7132
Cadet 4th Class
Posts: 13
Joined: Mon Jan 27, 2020 10:56 pm

Post by kennj7132 » Sun Feb 02, 2020 6:02 pm

Doesn't seem to make any difference to the warping when looking up and down. I tried that setting a bit higher and everything gets too big.

Changing the fov with xwahacker, 152 feels like I'm sat in the back, every direction warps when viewing, 110 would have my face on the dash, around 130 feels like the right place but it warps a bit left and right and still the strange bowing is there up and down (look up and objects magnify or shrink, look down and the floor drops away from you) I made a video to put YouTube to show you with various fov settings but it's not as striking.

User avatar
keiranhalcyon7
Lieutenant JG
Posts: 524
Joined: Tue Jan 02, 2018 6:41 am

Post by keiranhalcyon7 » Sun Feb 02, 2020 8:47 pm

130 in xwahacker would be 94 after correction for the math bug. I read that the Rift S has a FOV of 95, so it doesn't surprise me that it feels more correct than the other attempts.

Regarding the distortion, though, I don't know. It sounds a bit like barrel distortion run amok. I'll have to defer to Trevor and/or blue_max.

User avatar
Trevor
Ensign
Posts: 301
Joined: Thu Dec 04, 2014 7:11 pm

Post by Trevor » Sun Feb 02, 2020 9:01 pm

Just for reference, here is my screen with the red part outside the FOV
Annotation 2020-02-02 204457.jpg
Trev
You do not have the required permissions to view the files attached to this post.

kennj7132
Cadet 4th Class
Posts: 13
Joined: Mon Jan 27, 2020 10:56 pm

Post by kennj7132 » Mon Feb 03, 2020 11:21 am

Thanks Trevor, hope I figure it out, I play a lot of vr and say in assetto corsa the cockpit is static but here the cockpit stretches and moves with my view so very off putting. Shame as this is a miracle to be able to play this in vr. Nuts

User avatar
blue_max
Lieutenant
XWAU Member
Posts: 941
Joined: Wed Mar 20, 2019 5:12 am

Post by blue_max » Mon Feb 03, 2020 6:42 pm

keiranhalcyon7 wrote:
Sun Feb 02, 2020 5:28 pm
Blue_max, what does 3d_aspect_ratio = 0.800 do?
When rendering VR images, the horizontal size of each eye is multipliled by this value before presenting it to the screen. So, a value of 0.8 would shrink both images a little bit.

I need to check the code to refresh my mind; but I believe there will be an interaction with the PreserveAspectRatio setting from ddraw.cfg. I *think* the final aspect ratio will probably be a combination of these two settings.

Also, thanks for helping out, keiranhalcyon7!

User avatar
keiranhalcyon7
Lieutenant JG
Posts: 524
Joined: Tue Jan 02, 2018 6:41 am

Post by keiranhalcyon7 » Sat Feb 08, 2020 12:00 am

I thought PreserveAspectRatio only affected 2d mode (the concourse and menus).

So if 3d_aspect_ratio = 0.800 shrinks the image horizontally, and kennj7132's current horizontal looks fine, maybe the correct adjustment is to set 3d_aspect_ratio to 1, and further reduce the FOV in xwahacker? kennj7132, can you try this?

I'm beginning to suspect that the headset's optics are messing with the apparent geometry of the screen, and that some special ddraw code would be needed to compensate.

User avatar
blue_max
Lieutenant
XWAU Member
Posts: 941
Joined: Wed Mar 20, 2019 5:12 am

Post by blue_max » Sat Feb 08, 2020 12:38 am

keiranhalcyon7 wrote:
Sat Feb 08, 2020 12:00 am
I thought PreserveAspectRatio only affected 2d mode (the concourse and menus).
From what I recall, when PreserveAspectRatio = 1, I get two black vertical bars on either side of the screen on both 2D menus and 3D content. If I set it to 0, then the black bars are gone and the image is stretched to cover the whole screen.
So if 3d_aspect_ratio = 0.800 shrinks the image horizontally, and kennj7132's current horizontal looks fine, maybe the correct adjustment is to set 3d_aspect_ratio to 1, and further reduce the FOV in xwahacker? kennj7132, can you try this?
Yes, that might be the case here. I'm also open to suggestions as to what further settings may be needed in VR to help in this area.

kennj7132
Cadet 4th Class
Posts: 13
Joined: Mon Jan 27, 2020 10:56 pm

Post by kennj7132 » Sat Feb 08, 2020 11:09 am

I had already increased it to 1.0 last time I tried and it seemed better still but not right. What fiv would you recommend in xwa hacker and I will try later?

I have it set to preserve aspect ratio = 1 so I will try with it off also.

User avatar
Trevor
Ensign
Posts: 301
Joined: Thu Dec 04, 2014 7:11 pm

Post by Trevor » Sat Feb 08, 2020 11:42 am

I must admit I cannot fathom why 2 oculus rift headsets are acting differently?

My settings work for me and I did forget to mention I have

Code: Select all

PreserveAspectRatio = 1
I can try and explain my settings to see if that might make any bugs apparent between headsets.

lets start with default VRParams

Under default I get a square "window" in the center of my vision for both the concourse and flight.
To fix this I set

Code: Select all

;fill the whole view in 3d and 2d (where 2d is like looking at a cinema screen and 3d envelops you
3d_window_size = 3
3d_window_zoom_out_size = 2.5
; Set the following to 1 to start the HUD in zoomed-out mode:
zoomed_out_on_startup = 1

concourse_window_scale = 20.000
The value of 3 was found through increasing the window size until there were no more black bars visible AND no more culled parts of hull (holes in hull)

The default settings however waisted horizontal resolution trying to get the top and bottom bars away, so I set

Code: Select all

3d_aspect_ratio = 0.800
concourse_aspect_ratio = 1.334
This forced the correct aspect of the 960x1080 screen and now when the sides touched the edge of the screen so did the top and bottom - HOWEVER, now the GUI was stretched vertically so I now use xwahacker to set

Code: Select all

640 x  720, Hud Scale 1.0
where 640x720 = 960x1080/1.5 - i.e. if HUDScale worked above 1.4 then I could have used 1.5 (however causes chopped text and since ddraw ignores the requested render res i use it purely for setting aspect ratio)

Now, because I set the 3dwindow size to 3x, we need to make our eyes 3x so I set

Code: Select all

IPD = 18
HOWEVER this is ignored in steamvr hence why I had to set

Code: Select all

"ipdOffset" : 0.12,
in steamvr.settings

lastly I set the correct FOV to stop the "magnified" vision. Now we get a full scene with things visibly 3d and you can feel as though you can touch them.

Have you set

Code: Select all

apply_lens_correction = 0
SteamVR does this already so doing it twice will have odd effects.

Trev

kennj7132
Cadet 4th Class
Posts: 13
Joined: Mon Jan 27, 2020 10:56 pm

Post by kennj7132 » Sat Feb 08, 2020 12:41 pm

Thanks for taking the time to write this Trevor, very much appreciated. I have followed all your settings, a few you list have changed so I will change those also.
In the last part you say you correct fov, do you do this with xwa hacker? I notice you don't mention it when talking about setting resolutions in it. I feel this can be the only thing that's wrong now, I have tried various fovs in xwahacker and never get the vertical view to not stretch/magnify.

User avatar
Trevor
Ensign
Posts: 301
Joined: Thu Dec 04, 2014 7:11 pm

Post by Trevor » Sun Feb 09, 2020 1:41 am

I did not mention FOV because it was covered in many posts above.

I did not use XWA Hacker (I suppose I should try) because at the time my understanding was as someone said "the FOV stated in XWAH is half the true value, so 90 = 45. since I wanted 110 I tried 220 which of course failed.
I therefor resorted to hex editing and through trial and error found 180 as a good number (the round trip of the cockpit took ~3 images)

However, the latest info says that XWAH needs a value of 150 - which it apparently accepts and spits out as 180 (0xB4) and that the true FOV of this value is 126.87 (a little more than required, so I might even try and tone this down a bit)

Trev

P.S.
Could you attach some screenshots of your setup to show what you mean about "stretched vertically" since this should not be happening (or there is a misunderstanding somewhere)

User avatar
keiranhalcyon7
Lieutenant JG
Posts: 524
Joined: Tue Jan 02, 2018 6:41 am

Post by keiranhalcyon7 » Sun Feb 09, 2020 4:06 am

Trev - FYI, the fonts only start breaking at HUD scale >= 1.5. I use 1.49, which I find is basically indistinguishable from 1.5. (You could even try 1.499 if you want, but at some point, if you keep adding 9s, xwahacker rounds it to 1.5 due to the limits of the floating point precision.)

That 126.87 value is vertical FOV. The corresponding horizontal FOV for 8:9 aspect ratio is 121.28.

Also, that "150" and "180" are different types of values and should not be confused. The units for 150 are degrees; the units for 180 are pixels. (The game does not internally store "degrees of FOV"; it stores "distance from viewport (in pixels)", from which (along with viewport size, also in pixels) the degrees of FOV can be calculated using the trig equations I've posted earlier.)

cylonsurfer
Cadet 4th Class
Posts: 14
Joined: Sun Feb 09, 2020 3:37 pm

Post by cylonsurfer » Sun Feb 09, 2020 4:14 pm

How do I get the mod working for a Valve Index? At the moment the game seems to render into a box in the center of my HMDs screen, its 3D but the picture doesn't take up my entire FOV and the cockpit seems way out of perspective and fishbowls as I look around...

Cheers

User avatar
Trevor
Ensign
Posts: 301
Joined: Thu Dec 04, 2014 7:11 pm

Post by Trevor » Sun Feb 09, 2020 4:16 pm

read above

cylonsurfer
Cadet 4th Class
Posts: 14
Joined: Sun Feb 09, 2020 3:37 pm

Post by cylonsurfer » Sun Feb 09, 2020 4:28 pm

I have and it makes no sense to me at all mate. All I know if that the Index has a res of 2880×1600 but I have no idea what I need to do with that info in order to get the game to show correctly in my HMD. I have read all through this topic about 6 times now and am none the wiser :S

I'd really appreciate some help, I bought the game after looking at the mods readme and thought it was pretty straight foward. That does not seem to be the case as the game does not show correctly in the HMD.

cylonsurfer
Cadet 4th Class
Posts: 14
Joined: Sun Feb 09, 2020 3:37 pm

Post by cylonsurfer » Sun Feb 09, 2020 4:50 pm

Can someone please give me a heads up on this? I know it's a pre-release and all but at the moment the whole things just doesn't work in my Valve Index...

cylonsurfer
Cadet 4th Class
Posts: 14
Joined: Sun Feb 09, 2020 3:37 pm

Post by cylonsurfer » Sun Feb 09, 2020 10:05 pm

I have read this thread so many times my eyes are bleeding. I have tried everything contained in this thread so I can play this game on my Index without image warping or odd zoom effects, from setting xwahacker to messing with VrParams.cfg. Nothing seems to work - can someone please, please explain how you set up this mod? It is so damn frustrating it is untrue, all I'd like is someone to explain what needs to be setup in order for the mod to work correctly, the mods readme seems simple, it mentions nothing about having issues with FOV and warped image - just copy this, that install this and play. This is not the case at all and there seems to be no real instruction detailing what the hell people are meant to be doing. So please would some one be so kind as to give me a heads up. Thank you.

KuMoNKo
Recruit
Posts: 7
Joined: Sat Dec 14, 2019 9:36 pm

Post by KuMoNKo » Sun Feb 09, 2020 10:21 pm

cylonsurfer wrote:
Sun Feb 09, 2020 4:28 pm
I have and it makes no sense to me at all mate. All I know if that the Index has a res of 2880×1600 but I have no idea what I need to do with that info in order to get the game to show correctly in my HMD. I have read all through this topic about 6 times now and am none the wiser :S

I'd really appreciate some help, I bought the game after looking at the mods readme and thought it was pretty straight foward. That does not seem to be the case as the game does not show correctly in the HMD.
My first post here, I'm sorry if I'm wrong with anything...
  • I would start using xwahacker to change the resolution.
  • Then probably, inside vrparams.cfg, you will find this line:

    Code: Select all

    3d_window_size = X.X
    I have it set to 2.500, which seems to be ok for my lenovo explorer. Index would need a greater size.
  • Make sure you selected in vrparams.cfg

    Code: Select all

    VR_Mode = SteamVR
    and in cockpitlook.cfg

    Code: Select all

    tracker_type = SteamVR
  • If you can, take a screenshots of what you see and/or better explain what you did (and what not) and your game state at this point, there may be some more help from the developers if your problem is better bounded.
  • Also, delete everything, re-download everything, make a copy of vrparams.cfg and cockpitlook.cfg and start tinkering with the originals.
    • Whenever you advance, make a new copy.
    • Whenever you think you messed it up, overwrite the messed up files with the last good ones and start again.

cylonsurfer
Cadet 4th Class
Posts: 14
Joined: Sun Feb 09, 2020 3:37 pm

Post by cylonsurfer » Sun Feb 09, 2020 10:39 pm

This is exactly what I have done despite the mods instructions mentioning nothing at all about XWAHacker...

1. Open XWAHacker, browse to my backup copy of XwingAlliance.exe
2. Set the res of 2800 x 1600 for 800x 600 and save.
3. Overwrite my main copy of XwingAlliance.exe with the updated version
4. Launch the game.

Result - FOV is way to small, everything is in a square box but looks to not fish bowl.

5. Edit VRParams 3d_window_size to zoom everything in a little - now everything is a mess and fishbowls.

Currently and I have no idea why, all of a sudden my camera is on the nose of the ship, not even in the cockpit anymore!

KuMoNKo
Recruit
Posts: 7
Joined: Sat Dec 14, 2019 9:36 pm

Post by KuMoNKo » Sun Feb 09, 2020 11:09 pm

Ok. Next you have to adjust the FOV on xwahacker and vrparams.cfg this thread or the vrmod's thread are full of maths about FOV and resolution. That will correct fisheye on one dorection, be it horizontal or vertical, at least.

About the initial position, if you press dot '.' twice (shortcut to hide and show the cockpit), it will recenter and reposition the camera.

User avatar
keiranhalcyon7
Lieutenant JG
Posts: 524
Joined: Tue Jan 02, 2018 6:41 am

Post by keiranhalcyon7 » Mon Feb 10, 2020 12:41 am

Wikipedia wrote:The headset uses a 1440×1600 LCD panel for each eye for a combined resolution of 2880×1600.
So, the correct resolution to enter in xwahacker is 1440x1600 (or, as Trev may use, a proportional downscale thereof).

For FOV, the Index is advertised at 130 degrees. I couldn't find any explanation of whether that's meant to be horizontal or vertical. If it's vertical, the value to enter for xwahacker FOV would be 153.75; if horizontal, 150.95. (With an appreciation ratio of 9:10 and such a high FOV, the difference between these two possibilities isn't very big, so the difference may not turn out to be very noticeable.)

Trev/blue_max, what does apply_lens_correction = 0 do? It sounds like the kind of setting that would require a variable effect, rather than a boolean, to me.

Post Reply