Page 9 of 19

Re: X-Wing Alliance VR mod

Posted: Wed May 13, 2020 4:39 pm
by blue_max
CaptainKoloth wrote:
Tue May 12, 2020 12:09 pm
I've been flying for a while in VR now and it's a blast! One minor thing: I'm having trouble getting the text to be readable. I tried changing around the SteamVR resolution but it didn't seem to do much, and I don't want to start breaking ddraw and other stuff. Is there a way to just make the HUD elements and targeting computer bigger so they're easier to see? I have the dynamic cockpit turned off (as that was REALLY tiny).
There are a few things you can try. First, make sure you've got "fixed_GUI = 1" in your VRParams.cfg: that'll fix the HUD in space, so you can look around and lean to get a closer look at things. Pressing Ctrl+Z will also shrink all the HUD near the center of the screen so that it fits better; but you'll have to lean forward anyway.

Enable DC and lean closer on the instruments. You can adjust the sensitivity of your motion in CockpitLook.cfg so that you don't have to lean too much.

Still with DC on, select the option that displays the HUD or remove the "erase_region" commands from the DC files and then add the following to your Dynamic_Cockpit.cfg:

Code: Select all

move_region = TARGET_AND_LASERS_REGION, 0.35,0.55,  0.65,0.90
move_region = LEFT_TEXT_BOX_REGION, 0.15,0.55,  0.35,0.90
move_region = RIGHT_TEXT_BOX_REGION, 0.65,0.55,  0.85,0.90
That'll resize some HUD regions and make them bigger. In fact, your Dynamic_Cockpit.cfg file should already have these commands in there commented out. You can try other coordinates to see what works better for you (the coordinates go from (0,0) to (1,1))

However, I strongly suggest you turn DC on and adjust your motion sensitivity so that you can lean to read stuff better. You'll have to do that anyway no matter what option you choose.

Re: X-Wing Alliance VR mod

Posted: Wed May 13, 2020 4:42 pm
by CaptainKoloth
blue_max wrote:
Wed May 13, 2020 4:39 pm
CaptainKoloth wrote:
Tue May 12, 2020 12:09 pm
I've been flying for a while in VR now and it's a blast! One minor thing: I'm having trouble getting the text to be readable. I tried changing around the SteamVR resolution but it didn't seem to do much, and I don't want to start breaking ddraw and other stuff. Is there a way to just make the HUD elements and targeting computer bigger so they're easier to see? I have the dynamic cockpit turned off (as that was REALLY tiny).
There are a few things you can try. First, make sure you've got "fixed_GUI = 1" in your VRParams.cfg: that'll fix the HUD in space, so you can look around and lean to get a closer look at things. Pressing Ctrl+Z will also shrink all the HUD near the center of the screen so that it fits better; but you'll have to lean forward anyway.

Enable DC and lean closer on the instruments. You can adjust the sensitivity of your motion in CockpitLook.cfg so that you don't have to lean too much.

Still with DC on, select the option that displays the HUD or remove the "erase_region" commands from the DC files and then add the following to your Dynamic_Cockpit:

Code: Select all

move_region = TARGET_AND_LASERS_REGION, 0.35,0.55,  0.65,0.90
move_region = LEFT_TEXT_BOX_REGION, 0.15,0.55,  0.35,0.90
move_region = RIGHT_TEXT_BOX_REGION, 0.65,0.55,  0.85,0.90
That'll resize some HUD regions and make them bigger. In fact, your Dynamic_Cockpit.cfg file should already have these commands in there commented out. You can try other coordinates to see what works better for you (the coordinates go from (0,0) to (1,1))

However, I strongly suggest you turn DC on and adjust your motion sensitivity so that you can lean to read stuff better. You'll have to do that anyway no matter what option you choose.
Thanks! I'll try these techniques and see which one works best.

Re: X-Wing Alliance VR mod

Posted: Wed May 13, 2020 11:08 pm
by MamiyaOtaru
blue_max wrote:
Wed May 13, 2020 4:26 pm
MamiyaOtaru wrote:
Wed May 13, 2020 11:03 am
BUT! Process affinity to 0 helped a whole lot. I'd had it at 2. With it set to 0, the new 2d stiff is still slower (min FPS drops from 29 to 22) but the occasional horrible stutter/hitch is gone.
I did find a simpler repro
Glad you are able to reproduce :) Without the hitches it's pretty bearable, and as long as it's an option one can choose whether to take the hit.

It still seems like it has an effect on fps disproportionate to what it does, hopefully you can find some fix. Thanks for all you are doing!

Re: X-Wing Alliance VR mod

Posted: Wed May 13, 2020 11:51 pm
by CaptainKoloth
MamiyaOtaru wrote:
Wed May 13, 2020 11:08 pm
blue_max wrote:
Wed May 13, 2020 4:26 pm
MamiyaOtaru wrote:
Wed May 13, 2020 11:03 am
BUT! Process affinity to 0 helped a whole lot. I'd had it at 2. With it set to 0, the new 2d stiff is still slower (min FPS drops from 29 to 22) but the occasional horrible stutter/hitch is gone.
I did find a simpler repro
Glad you are able to reproduce :) Without the hitches it's pretty bearable, and as long as it's an option one can choose whether to take the hit.

It still seems like it has an effect on fps disproportionate to what it does, hopefully you can find some fix. Thanks for all you are doing!

Can I second that- so many people across many different games either announce these grandiose mods and then never do anything, or they deliver essentially a tech demo and then disappear. But not only did you create something awesome and fully functional, but you're continuing to give your own time for free to debug and make it better. I salute you, sir!

Re: X-Wing Alliance VR mod

Posted: Thu May 14, 2020 1:18 am
by blue_max
Thanks for your comments guys. I've been looking at this area of the code and trying to figure out why it only seems to impact the new shaders and not Jeremy's ddraw. I do not have an answer yet; but I'll keep looking...

Re: X-Wing Alliance VR mod

Posted: Tue May 26, 2020 4:26 am
by Joryn
I sure am having a hell of a time getting some playable settings on my CV1. The distortion is a bit much. Did anyone ever come up with a good set of settings for a CV1?

Re: X-Wing Alliance VR mod

Posted: Tue May 26, 2020 9:51 am
by Trevor
Did you try my calibration opt? viewtopic.php?p=164539#p164539

download that, go to proving grounds and check your settings using all the keyboard shortcuts provided by blue and then you tell us what the settings for CV1 are.

Trev

Re: X-Wing Alliance VR mod

Posted: Thu Jun 04, 2020 7:53 am
by ptisinge
Trev,

I tried using your calibration (thanks a lot for doing this!) but with my OG Vive I couldn't get to a result where I didn't have some distortion (yet I'm relying on the setting that lets steamVR do that) and if I adjusted the fov to allow me to see around 55 degrees on each side then the distortion was really bad. I did notice that you mentioned getting the resolution set up to a particular value - but if I understand rightly, in the current version of Blue max vr mod overrides the settings done with xwhacker, so does that interfere with your calibration perhaps? Or I must be missing something... I've been trying to make this work for a while now, trying occasionally then giving up for a few months.

Re: X-Wing Alliance VR mod

Posted: Thu Jun 04, 2020 6:32 pm
by Trevor
The use of XWA HAcker is still required until Blue implements "2D Aspect Ratio".
Currently the only options are -

Code: Select all

3d_aspect_ratio = 0.888
concourse_aspect_ratio = 1.333
but this does not fix the hud and text ratio.

can you post screenshots of the distortion - too many posts of "its distorted" but no images, and please post an image, no dodgy shaky-cam youtube videos :kopfwand: .

Trev

Re: X-Wing Alliance VR mod

Posted: Fri Jun 05, 2020 3:50 am
by ptisinge
I'll probably try capturing a video because the distortion is better seen in movement when I rotated my head. A typical manifestation of it is that when I rotated my head from left to right in the A-Wing, the front circular strut sorts of bends/warps laterally instead of looking retaining its shape.

Re: X-Wing Alliance VR mod

Posted: Fri Jun 05, 2020 5:09 pm
by blue_max
I know this may sound a bit weird; but how about this: restore the original resolutions and FOV used by the game using xwahacker, or just using an unmodified xwingalliance.exe. Delete the Focal_Length.cfg file and any *.dc files under the DynamicCockpit folder. Then select either 1280x1024 or 1600x1200 for the in-game resolution and see if there's any distortion that way.

The reason is that I'm noticing some unexpected interaction between the in-game FOV and the 3D reconstruction that I wasn't aware of when I coded the VR path. I'm just noticing that now as part of the work I'm doing for shadow mapping and I'm wondering if it's related.

Re: X-Wing Alliance VR mod

Posted: Sat Jun 06, 2020 1:31 am
by ptisinge
Ok thanks Blue Max, I'll do that. I was just about to do a full re-install anyway, so I'll do what you've listed too

Re: X-Wing Alliance VR mod

Posted: Sat Jun 06, 2020 2:30 am
by ptisinge
Ok, I've tested replacing the exe by the original xwingalliance.exe, then deleted the focallength file and all .dc in the dynamic cockpit folder, then selected 1280x1024 and I unfortunately had a really strong distortion. The horizontal fov was definitely wrong - testing that with Trev scene revealed I had about 40 degrees of total horizontal fov only. Looking up and down was warping the picture really bad.

I then tried using Trev scene to set things up properly for Vive, i.e. setting an horizontal fov at around 108 degrees, and adjusting everyting so that the screen was filled properly, but that didn't result in an undistorted image

Has anyone here succesfully used this mod with the OG Vive? If yes I would be really keen on comparing settings.

Re: X-Wing Alliance VR mod

Posted: Sat Jun 06, 2020 6:11 pm
by Trevor
PICTURES!!!

Re: X-Wing Alliance VR mod

Posted: Sat Jun 06, 2020 6:15 pm
by Darksaber
lol

it starts to get a bit :kopfwand: :explode: :curse: :grumbleshield: :datz: after a while

Re: X-Wing Alliance VR mod

Posted: Sun Jun 07, 2020 6:31 am
by blue_max
I've been looking at this distortion problem and, at the moment, I don't think there's much you guys can do to fix this distortion: the 3D reconstruction code that I'm using for VR is bugged.

When I started this project, I didn't know much about how XWA handles the camera and the FOV, so I had to make a number of assumptions. I *knew* the focal length was a key factor for 3D reconstruction; but I had no way of knowing what XWA was using for that value. I used a value of 1 or 2, depending on what looked good to me and moved on.

But now I know where XWA stores the focal length and can even control it (thanks to several people who have helped me along the way). I've been dumping the 3D reconstruction that the VR path is using and now I can see there's 3 problems:

1. The camera isn't looking straight ahead: it's shifted along the Y axis (the aiming reticle isn't centered on the screen) and it seems to be slightly rotated down.
2. The FOV affects the scale of the 3D reconstruction. The FOV changes depending on what resolution XWA is working on.
3. There's a skew or shear transform along the Y-Z axes. The bigger the depth, the more the Y axis is skewed. If you look around, the direction of the Z axis changes, with respect to the cockpit, so the direction of shear also changes.

... and on top of that there's the actual resolution that DirectX/SteamVR is rendering on, so there's a further stretch from in-game resolution to screen/VR resolution that needs to be factored in as well.

I hypothesize that the lens geometry of some visors makes the above distortions more apparent than others, so that's why some people see problems and some don't.

SteamVR won't work unless I've got a metric 3D reconstruction. So that's the first thing I have to get right. It's going to take a while to get right, though; but at least now I can see what needs to be done.

So, for now, if it doesn't work, just leave it alone, sorry. I need to go back to the math and figure this out.

BTW: If someone knows where XWA stores the camera matrix, that would help too.

Re: X-Wing Alliance VR mod

Posted: Mon Jun 08, 2020 5:20 pm
by Rogue 10
I got the VR to work today. It was fun and a fulfilment of a dream since 93.
I was using a 980 GTX with an Oculus Rift S with an older I7 - 16 gig Ram
Running in Steam VR

I tried all different settings from the Blue Max patch.
Most of this you already know but here was my experience.

-Game looks gorgeous in VR - so much potential. But there are Performance issues.
-severe framerate issues when in the concourse. Tried it with both multicore on and off. Seems to be an issue between Steam and XWA.
- Tracking does not work in the Hangar. (But you guys know that)
- Performance was very affected by the polygon counts of the ships. Its was bad enough where Im going to o back to not using the VR unfortunately.
-The Framerate was just not there, whatever I did.
-I ran resolution in 60% in my Steam App. Helped a bit. But there seems to be something else slowing it down. Performance was worst when moving my head around a lot, if I kept my head still, it was better.
- I tried it with almost all effects off, and it still has problems, especially with high polygon ships.
- I got the FOV perfect with the tools provided, - Nice job.
This was fun to try out, tons of potential.. But in its current state the performance it too low to use to play through the campaign with.

I would be willing to help you guys test!

-
-

Re: X-Wing Alliance VR mod

Posted: Mon Jun 08, 2020 6:56 pm
by blue_max
Thanks for trying out the VR mod, Rogue 10. The biggest performance problem with SteamVR is a blocking call to WaitGetPoses() that won't return control to ddraw until the images have been presented to the headset. The idea is that your renderer should be multi-threaded so that you can continue to process the next frame while you wait for this call to return. Problem is, XWA is not a multi-threaded renderer and doing the conversion might be extremely difficult.

You don't have to take my word for it, though. If you install the DirectSBS version, you'll see the same VR content; but without SteamVR. You'll see a big improvement in performance. If your headset has an option to display Side-by-Side content directly, then you might be able to use this option. I have no trouble sustaining 45-60fps in DirectSBS mode.

Unfortunately, for SteamVR, the only way to go for now is to reduce the resolution of the headset, and use lower settings for the effects. I run at 50% resolution, and while it isn't great, it's also not that bad, and I've been able to play full missions in SteamVR with only minor bumps in performance.

The thing that confuses me are your statements about the Concourse: this is where the performance should be at its maximum since it isn't rendering much (it's rendering only 2 triangles). Except when loading missions, I have no trouble getting 60fps here, so maybe there's something else on your side that's causing problems? Are you using the latest hook_time.dll? If you have a "60fps" hook, try disabling that.

Re: X-Wing Alliance VR mod

Posted: Mon Jun 08, 2020 7:29 pm
by Rogue 10
For now, Im trying to get XWA to run back on my PC screen. But I'm having trouble.
- Steam VR keeps trying to Launch is in VR now. Checked a few forums, and there was no easy fix for this, So I uninstalled Steam VR.

Now, when I launch XWA, it goes to a Black screen. I can hear the concourse in the background. Only way out of it, is to go to task manager and kill XWA.

Thanks.

Re: X-Wing Alliance VR mod

Posted: Mon Jun 08, 2020 7:53 pm
by Ace Antilles
Rogue 10 wrote:
Mon Jun 08, 2020 7:29 pm
For now, Im trying to get XWA to run back on my PC screen. But I'm having trouble.
- Steam VR keeps trying to Launch is in VR now. Checked a few forums, and there was no easy fix for this, So I uninstalled Steam VR.

Now, when I launch XWA, it goes to a Black screen. I can hear the concourse in the background. Only way out of it, is to go to task manager and kill XWA.

Thanks.
Have you let Steam overwrite files? Because if it does then it can mess up the XWAUP fixes.
Make sure you have the correct DDraw file for the normal install or the Effects install.
The XWAUCP should overwrite the need to have Steam running.

Re: X-Wing Alliance VR mod

Posted: Mon Jun 08, 2020 8:06 pm
by Rogue 10
:?
I tried reinstalling the Blue Max patch with No VR option. No dice. any other ideas? :?

Re: X-Wing Alliance VR mod

Posted: Mon Jun 08, 2020 8:31 pm
by Rogue 10
OK, Just fixed it. reinstalling the Blue max patch did not fix it.. I had to go in and manually replace the ddraw file with a backup copy.
Thanks for the help Ace.

Re: X-Wing Alliance VR mod

Posted: Tue Jun 09, 2020 1:43 am
by keiranhalcyon7
Blue_max, would it be possible to have ddraw spawn a second thread when it starts up in SteamVR mode, whose sole purpose is to execute the WaitGetPoses() calls when told to by the main thread?

Re: X-Wing Alliance VR mod

Posted: Tue Jun 09, 2020 5:23 am
by blue_max
keiranhalcyon7 wrote:
Tue Jun 09, 2020 1:43 am
Blue_max, would it be possible to have ddraw spawn a second thread when it starts up in SteamVR mode, whose sole purpose is to execute the WaitGetPoses() calls when told to by the main thread?
This is a reasonable suggestion; but it doesn't work. The thread that executes the draw() calls must be the same thread that calls WaitGetPoses(). These were among the first things I tried when I started learning OpenVR. The other thing I tried was to have a dedicated thread that gets a copy of the buffers sent to SteamVR and sends those buffers. I think this actually kind of works for a couple of seconds before crashing. I _believe_ that SteamVR has to block/synchronize the GPU so that's why using a different thread won't work.

I believe one way to solve this would be to have a queue of ExecuteBuffers so that XWA can push data down to ddraw and return immediately while ddraw has a renderer thread that consumes this queue of ExecuteBuffers. However, I don't know if XWA will perform other calls while this buffer is executed (thus causing race conditions and random crashes), and I don't know how to sync this renderer thread with XWA either. Either way, this would be a big project. But who knows? Maybe one day...

Re: X-Wing Alliance VR mod

Posted: Tue Jun 09, 2020 6:05 am
by keiranhalcyon7
blue_max wrote:
Tue Jun 09, 2020 5:23 am
These were among the first things I tried when I started learning OpenVR.
Right. Of course they are. You know what you're doing.
The other thing I tried was to have a dedicated thread that gets a copy of the buffers sent to SteamVR and sends those buffers. I think this actually kind of works for a couple of seconds before crashing. I _believe_ that SteamVR has to block/synchronize the GPU so that's why using a different thread won't work.
If SteamVR has to block the GPU, I have to wonder how anything could be expected to get on with (useful) work while it's blocking.
I believe one way to solve this would be to have a queue of ExecuteBuffers so that XWA can push data down to ddraw and return immediately while ddraw has a renderer thread that consumes this queue of ExecuteBuffers. However, I don't know if XWA will perform other calls while this buffer is executed (thus causing race conditions and random crashes), and I don't know how to sync this renderer thread with XWA either. Either way, this would be a big project. But who knows? Maybe one day...
Hmm... maybe a double buffer? Shunt one to ddraw, and capture any subsequent calls from the engine in the second... although, maybe they would not make sense without the context of the first. (?) Yeah, it's kind of a "Computer Graphics 101" suggestion, but it's all I've got.