This setting applies a common lens correction algorithm to the images before displaying them. For DirectSBS this is necessary to fix the distortion. In SteamVR this is optional because SteamVR applies its own algorithm. It's an on/off switch; but the parameters themselves can be modified arbitrarily. For SteamVR, I sometimes use negative values to invert the distortion applied by SteamVR; but in my case, SteamVR looks good without this, so I usually leave it off.
5dof support for TrackIR and improved 6dof for VR
Moderator: JeremyaFr
Re: 5dof support for TrackIR and improved 6dof for VR
- blue_max
- Posts: 2296
- Joined: Wed Mar 20, 2019 5:12 am
-
- Posts: 13
- Joined: Tue Feb 11, 2020 1:13 am
Continuing on here from Youtube comments as VanillaEssence. I keep getting the "fishbowl effect no matter what I try. Would someone be willing to share their game files for the Steam version for SteamVR if that is not against the rules. I'd like to see if it is just a mistake I have made or just a bizarre seemingly unresolvable issue. thanks
Edit: I have uploaded a video to try to demonstrate whats happening: https://youtu.be/Qv8_Ss9NuJc
It seems I may also not have 6dof enabled, but I'm not really sure with this issue happening. Is that something I need to set up seperately? Thanks
Edit: I have uploaded a video to try to demonstrate whats happening: https://youtu.be/Qv8_Ss9NuJc
It seems I may also not have 6dof enabled, but I'm not really sure with this issue happening. Is that something I need to set up seperately? Thanks
- blue_max
- Posts: 2296
- Joined: Wed Mar 20, 2019 5:12 am
Trevor has posted details on how he setup his system for SteamVR, look at some of the previous comments in this thread. If you've got release 1.1.0 (https://www.dropbox.com/s/g4s08oxgtpu67 ... 0.zip?dl=0), I also provided some sample config files for SteamVR inside the package. Look for VRParams.cfg.SteamVR and CockpitLook.cfg.SteamVR. However...VanillaEssence wrote: ↑Wed Feb 12, 2020 12:24 amContinuing on here from Youtube comments as VanillaEssence. I keep getting the "fishbowl effect no matter what I try. Would someone be willing to share their game files for the Steam version for SteamVR if that is not against the rules. I'd like to see if it is just a mistake I have made or just a bizarre seemingly unresolvable issue. thanks
To me, this looks like you've got "apply_lens_correction" set to 1 in VRParams.cfg. Before going any further, open VRParams.cfg and make sure "apply_lens_correction" is set to 0 in there. That's probably all you need to do to fix this.Edit: I have uploaded a video to try to demonstrate whats happening: https://youtu.be/Qv8_Ss9NuJc
6dof was enabled in release 1.1.0 and you need to configure the positional tracking in CockpitLookHook.cfg. I provided some sample files for SteamVR in the install package.It seems I may also not have 6dof enabled, but I'm not really sure with this issue happening. Is that something I need to set up seperately? Thanks
-
- Posts: 13
- Joined: Tue Feb 11, 2020 1:13 am
Thank you I realised I didnt rename my example cfg files which was the problem. I've got everything working okay now exact that the cockpit is too large. I tried trevors hexedit fix but I didn't notice any effect from it. It's possible I did it incorrectly. It seems like I have the same issue as kennj with a small amount of warping happening when I move my head up and down, plus the cockpit of the xwing is very large. Using XWA hacker to change fov does not seem to have an effect of how large things feel. I realise there's probably something very obvious I'm missing here, so sorry for all the questions. Thanks!
- blue_max
- Posts: 2296
- Joined: Wed Mar 20, 2019 5:12 am
To fix the size of the objects you need to change the IPD in steamvr.settings, like Trevor said:
Code: Select all
"ipdOffset" : 0.12,
Regardless of the above, changing the FOV should have some effect too.
-
- Posts: 13
- Joined: Tue Feb 11, 2020 1:13 am
Thanks missed that in the post. I've set ipdOffset" : 0.111 which seems to be about the right size for the cockpit to me, I guess I'll need to disable this setting when playing other games. The game is pretty playable now and it's an amazing feat you've managed to pull off. However, I'm having an issue of a fairly small amount of warping in the cockpit when I move my head. On my monitor the game looks great and I can't notice any warping but in the headset the cockpit moves slightly when I move my head. For example when I move my head up and down the front xwing console appears to get longer and shorter and say if I look at the left pedal to the right pedal one pedal seems to move closer while the other moves further away. I've only noticed this in the cockpit but I imagine it's happening to everything in the game. Is this expected behaviour as a result of this being a mod or is there something else I have set up incorrectly. I'm using Trevor's settings (I think I've done it correclt but for an HTC Vive if that makes any difference. I feel like I'm so close to having an awesome experience but the warping is just slightly too uncomfortable for me to play. Any assistance would be greatly appreciated Thank you.
- blue_max
- Posts: 2296
- Joined: Wed Mar 20, 2019 5:12 am
You should not see the warping you're reporting. Trevor doesn't seem to see the warping and I don't either. I think the warping can be fixed with the right FOV setting.
Unfortunately, this is an area I that have very little experience with. If you tried Trevor's settings and that didn't work, then I would suggest that you try different values to see if that changes your experience. Lower down the FOV and see if that helps, if not, go the other way...
The other thing I can do is add another setting in VRParams to stretch the image vertically; but you'll have to wait a little bit for that.
Or maybe I could also try to overwrite the offset in XWA where the FOV is stored and see if that takes effect immediately? I need to search the forum to find where the FOV is located...
Unfortunately, this is an area I that have very little experience with. If you tried Trevor's settings and that didn't work, then I would suggest that you try different values to see if that changes your experience. Lower down the FOV and see if that helps, if not, go the other way...
The other thing I can do is add another setting in VRParams to stretch the image vertically; but you'll have to wait a little bit for that.
Or maybe I could also try to overwrite the offset in XWA where the FOV is stored and see if that takes effect immediately? I need to search the forum to find where the FOV is located...
- keiranhalcyon7
- Posts: 599
- Joined: Tue Jan 02, 2018 6:41 am
There are a few variables related to FOV:
0x91AB6C = raw FOV dist (dword int), copy of one of the six values hard-coded with the resolution slots, which are what xwahacker edits
0x8B94CC = FOV dist (float), same value as above
0x8B94BC = cached FOV dist / 512.0 (float), seems to be used for some sprite processing
They seem to respond fine to dynamic changes, so you could probably make hotkeys to increase/decrease the FOV in-flight.
0x91AB6C = raw FOV dist (dword int), copy of one of the six values hard-coded with the resolution slots, which are what xwahacker edits
0x8B94CC = FOV dist (float), same value as above
0x8B94BC = cached FOV dist / 512.0 (float), seems to be used for some sprite processing
They seem to respond fine to dynamic changes, so you could probably make hotkeys to increase/decrease the FOV in-flight.
Last edited by keiranhalcyon7 on Fri Feb 14, 2020 12:25 am, edited 1 time in total.
-
- Posts: 13
- Joined: Tue Feb 11, 2020 1:13 am
Has anyone else tried this mod out with an HTC Vive?
I realised I didnt update my "positional_x_multiplier" settings, so I did to match Trevor's which made the experience more comfortable. It also seems to have have the warping effect less noticeable, however it is still present. The wider FOV seems worse than around 110 or so. I'd like to play around more with the fov settings but its starting to make me feel a little sick. I believe the warping is occurring on both axes.
Update: I just tried to record a video through the lens and realised the video didn't have the problem. I then tried playing with one eye closed and I'm not 100% sure but it seems to fix the issue. So thing is going wrong somewhere either with my eyes or with the 3d right? It's possible that playing with one eye just makes the issue less noticeable but I do think there issue is not there when only seeing one image
I realised I didnt update my "positional_x_multiplier" settings, so I did to match Trevor's which made the experience more comfortable. It also seems to have have the warping effect less noticeable, however it is still present. The wider FOV seems worse than around 110 or so. I'd like to play around more with the fov settings but its starting to make me feel a little sick. I believe the warping is occurring on both axes.
Update: I just tried to record a video through the lens and realised the video didn't have the problem. I then tried playing with one eye closed and I'm not 100% sure but it seems to fix the issue. So thing is going wrong somewhere either with my eyes or with the 3d right? It's possible that playing with one eye just makes the issue less noticeable but I do think there issue is not there when only seeing one image
- blue_max
- Posts: 2296
- Joined: Wed Mar 20, 2019 5:12 am
Thank you keiranhalcyon7, I can add shortcut keys to change the FOV in real time.
@VanillaEssence: It should be possible to play without seeing this warping issue. I believe it's either the aspect ratio or FOV or a combination of these things. I believe others have been able to play using the Vive; but the warping issue hasn't been reported until recently. BTW: you're not getting a blurry/double image, right? The problem nos is just that the image is warped when looking up and down, correct?
@VanillaEssence: It should be possible to play without seeing this warping issue. I believe it's either the aspect ratio or FOV or a combination of these things. I believe others have been able to play using the Vive; but the warping issue hasn't been reported until recently. BTW: you're not getting a blurry/double image, right? The problem nos is just that the image is warped when looking up and down, correct?
-
- Posts: 13
- Joined: Tue Feb 11, 2020 1:13 am
I don’t believe it’s a blurry or double image but the warping only appears to be visible with both eyes open. The image is warped when looking any direction not just up and down. Thank you for all your help
- blue_max
- Posts: 2296
- Joined: Wed Mar 20, 2019 5:12 am
If the SteamVR camera matrices are not used properly, then you get blurry/double images. I just wanted to double-check that this *wasn't* the case here. I'm going to try and add keys to adjust the FOV in real time to see if that makes it easier to debug/fix this issue.VanillaEssence wrote: ↑Fri Feb 14, 2020 12:12 amI don’t believe it’s a blurry or double image but the warping only appears to be visible with both eyes open. The image is warped when looking any direction not just up and down. Thank you for all your help
- Trevor
- Posts: 541
- Joined: Thu Dec 04, 2014 7:11 pm
Clearly Steam ipd is a problem and since it mostly fixed VanillaEssence, I wonder if that is also the problem for kennj7132.
I wonder if you can change that value (assume steam is installed in its default location) before steam loads, and reset on exit?
Changing FOV as part of the ini will be far better than hex editing (or using XWAH) but you will need to be able to select the slot.
Trev
I wonder if you can change that value (assume steam is installed in its default location) before steam loads, and reset on exit?
Changing FOV as part of the ini will be far better than hex editing (or using XWAH) but you will need to be able to select the slot.
Trev
- blue_max
- Posts: 2296
- Joined: Wed Mar 20, 2019 5:12 am
The user may run SteamVR before running XWA, I have no control over that. I haven't seen anything in the API that lets me set the IPD either.
OK, that sounds good; but what do you mean by "slot" here?Changing FOV as part of the ini will be far better than hex editing (or using XWAH) but you will need to be able to select the slot.
- keiranhalcyon7
- Posts: 599
- Joined: Tue Jan 02, 2018 6:41 am
Trevor - by altering the variables I listed, blue_max can alter the FOV completely independently of the active resolution slot.
Actually, with the modern state of hook development, the slots themselves could be wholely circumvented and replaced with "just use these values from this text file".
- blue_max
- Posts: 2296
- Joined: Wed Mar 20, 2019 5:12 am
Oh, the resolution slot? Yeah, I agree with keiranhalcyon here, I just assumed that the FOV would apply regardless of the resolution selected.keiranhalcyon7 wrote: ↑Fri Feb 14, 2020 11:57 pmTrevor - by altering the variables I listed, blue_max can alter the FOV completely independently of the active resolution slot.
-
- Posts: 13
- Joined: Tue Feb 11, 2020 1:13 am
I did try adjusting the IPD on my headset with the game running using the little knob but it didn’t resolve the issue. I don’t know how to change it outside of steam vr running. Obviously I should say I don’t have this issue on other games.
Edit: I was wrong about this only occurring with one eye open, that just reduced how obvious the distortion was. I'm still playing around with my settings trying to find the sweet spot. Adding VR to games not designed for it is much more complicated than I thought
I think the issue does lie somewhere with the FOV and with 3d_aspect_ratio. Changing these seems to improve it but I'm not able to experiment very much without feeling sick.
Edit: I was wrong about this only occurring with one eye open, that just reduced how obvious the distortion was. I'm still playing around with my settings trying to find the sweet spot. Adding VR to games not designed for it is much more complicated than I thought
I think the issue does lie somewhere with the FOV and with 3d_aspect_ratio. Changing these seems to improve it but I'm not able to experiment very much without feeling sick.
- blue_max
- Posts: 2296
- Joined: Wed Mar 20, 2019 5:12 am
Well, the good news is that I was able to change the FOV in real time using keiranhalcyon7's offsets. Now I'm going to see if I can repro the issue on my end, and maybe figure out a way to fix this...
@keiranhalcyon7: The FOV distance units are probably in pixels, right? Fun stuff, this here thing...
@keiranhalcyon7: The FOV distance units are probably in pixels, right? Fun stuff, this here thing...
- keiranhalcyon7
- Posts: 599
- Joined: Tue Jan 02, 2018 6:41 am
Yep. Pixels. So if you wanted to display the FOVs in degrees in an overlay, you'd have to do some math, using the display width/height and some basic trig.
- blue_max
- Posts: 2296
- Joined: Wed Mar 20, 2019 5:12 am
Pixels! I'm not that worried about the angle itself; but measuring distance in pixels is a bit weird. If the FOV was specified in millimeters that would help me make a perfect metric reconstruction; but pixels... that's just weird. I mean, how big is a pixel anyway?
Anyway, not a showstopper, I'm just going to add another free parameter ("pixel-to-mm-conv-factor" or something like that). This information is very valuable nonetheless, so thanks again, keiranhalcyon7!
- keiranhalcyon7
- Posts: 599
- Joined: Tue Jan 02, 2018 6:41 am
What? The screen resolution is measured in pixels, so so is the FOV distance. What do mm have to do with anything?
- blue_max
- Posts: 2296
- Joined: Wed Mar 20, 2019 5:12 am
In real life, the focal length is usually measured in mm, while FOV is an angle. In this case "FOV distance" seems to be the distance between the image plane and the center of projection, or, in other words, it's actually the focal length.keiranhalcyon7 wrote: ↑Sun Feb 16, 2020 5:23 amWhat? The screen resolution is measured in pixels, so so is the FOV distance. What do mm have to do with anything?
This doesn't matter for the game, obviously; but it matters in VR because we're supposed to project from metric 3D space into 2D space using fixed projection matrices. These matrices encode a focal length too. This focal length is probably the distance between the retinas in your eyes to the lenses (or similar). That's why -- at least for VR -- it makes no sense to measure the focal length in pixels. If the focal length in the VR projection matrices doesn't match the actual focal length used by the game, then we get artifacts.
Anyway, as I said before, not a showstopper. I was just hoping that the focal length would be in mms so that things would make sense.
- keiranhalcyon7
- Posts: 599
- Joined: Tue Jan 02, 2018 6:41 am
Oh, I see! Well... the game was not designed with VR in mind - all they were worrying about was an image size, measured in pixels, and perf on the hardware of the day. So in that context, storing the focal length in pixels made the most sense.
Maybe the correct conversion factor is just the pixels per mm of the headset's displays?
Maybe the correct conversion factor is just the pixels per mm of the headset's displays?
-
- Posts: 15
- Joined: Sun Feb 09, 2020 3:37 pm
This still results in the image warping. I create mods myself but I'd never expect my users to jump through all these hoops in order to use my content. How is an end user meant to use this mod and not feel sick? The image warps all over the place and looks very bad. Can someone please let me know what settings are required to use this mod on a Valve Index?
Setting a FOV of 150.95 @ 1440 x 1600 in XWAHacker and 3d_aspect_ratio to 1.5095 in VRParams results in an image which doesn't warp when looking left / right but warps a lot while looking up / down, additionally the image is stretched horizontially so circles (planets etc) looks squashed and there are visible bars on top / bottom of the screen. If I lower 3d_aspect_ration I can get rid of the streched look but then the image wraping on all axis reappears
Setting a FOV of 150.95 @ 1440 x 1600 in XWAHacker and 3d_aspect_ratio to 1.5095 in VRParams results in an image which doesn't warp when looking left / right but warps a lot while looking up / down, additionally the image is stretched horizontially so circles (planets etc) looks squashed and there are visible bars on top / bottom of the screen. If I lower 3d_aspect_ration I can get rid of the streched look but then the image wraping on all axis reappears
- Trevor
- Posts: 541
- Joined: Thu Dec 04, 2014 7:11 pm
Ok, so first, the "circles are squished" is only fixed by :
* 3d_aspect_ratio which for Oculus DK2 was 0.8 (technically 0.8888 but the extra digits actually still squished the image) - this fixes "3D" things like planets and hulls
* Internal Resolution of game (eg, 640x720 (matching ratio (0.8888)) - This fixed HUD elements and on-screen text ^1
These 2 attributes MUST match (the concourse_aspect_ratio is separate and allows for the "cinema screen" during concourse only - and should be 1.333 as the image is 640x480)
^1 I also confirmed that there is a visible difference between 640x720x1 and 960x1080x1.49 as the text does in fact break at 1.49 whereas it renders clearly using the former.
My screenshot -to me- looks fine and doesn't warp, therefor without more information I cannot suggest anything else other than my own settings.
As for feeling sick... that isn't really our fault...
Anyway, I was looking at DirectX and the Perspective matrix needs radians so they probably had to do the maths same as us.
It could be that in early 2D the fov was essentially the resolution of the near plane (eg, near plane 200x150, far plane 640x480) and with a fixed z depth you essentially get a 45 degree pyramid (giving 90 degrees fov)
Although honestly it seems more work to keep the old code than to simply replace it with a radian value.
Trev
* 3d_aspect_ratio which for Oculus DK2 was 0.8 (technically 0.8888 but the extra digits actually still squished the image) - this fixes "3D" things like planets and hulls
* Internal Resolution of game (eg, 640x720 (matching ratio (0.8888)) - This fixed HUD elements and on-screen text ^1
These 2 attributes MUST match (the concourse_aspect_ratio is separate and allows for the "cinema screen" during concourse only - and should be 1.333 as the image is 640x480)
^1 I also confirmed that there is a visible difference between 640x720x1 and 960x1080x1.49 as the text does in fact break at 1.49 whereas it renders clearly using the former.
Please can someone show a screenshot of this... How can we help if you all keep saying its broken but not showing where yet when we try we have no problem.This still results in the image warping.
My screenshot -to me- looks fine and doesn't warp, therefor without more information I cannot suggest anything else other than my own settings.
This project is still a WIP. Also as Blue stated, there are unfortunately some settings that are unable to be touched at runtime at this time.I create mods myself but I'd never expect my users to jump through all these hoops in order to use my content. How is an end user meant to use this mod and not feel sick?
As for feeling sick... that isn't really our fault...
I thought focal length was the distance to an object in focus (with z values outside that blurring)In real life, the focal length is usually measured in mm, while FOV is an angle. In this case "FOV distance" seems to be the distance between the image plane and the center of projection, or, in other words, it's actually the focal length.
Anyway, I was looking at DirectX and the Perspective matrix needs radians so they probably had to do the maths same as us.
It could be that in early 2D the fov was essentially the resolution of the near plane (eg, near plane 200x150, far plane 640x480) and with a fixed z depth you essentially get a 45 degree pyramid (giving 90 degrees fov)
Although honestly it seems more work to keep the old code than to simply replace it with a radian value.
Trev