X-Wing Alliance VR mod

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

Moderators: Darksaber, General_Trageton, Forceflow, JeremyaFr, DTM

Re: X-Wing Alliance VR mod

Darkblue
Cadet 2nd Class
Posts: 87
Joined: Sun Mar 09, 2003 12:01 am

Post by Darkblue » Sun Dec 08, 2019 12:56 pm

Hi blue_max, this is a wonderful fix. I see that in VR you have solved a lot of the problems I found the hardest to solve so to make it work fine in 3DVision/pageflipping (target CMD, and HUD).

But this is only for VR. As a guy of no-VR but enthusiast of 3DVision (3D screen + glasses) I tested it with VR_Mode = None in VRparams.cfg, and when entering 3D mode, all depth glitches are back (I guess your fix for VR is bypassed).

I was wondering if maybe you could add a mode for 3D screens (3D Vision/pageflipping). AFAIK it should be something that uses your fixes, so generates one "image" (but only one, not both left and right) and send that "image" to the driver so 3dvision driver could generate both images (left and right). Maybe it would be enough bypassing the part of your code that generates the two images (left and right). It seems relatively easy (although I actually don't know for sure).

Another thing, it would be very convenient to add the Fullscreen option back to ddraw.cfg, otherwise you have to use Alt+Enter to trigger 3D mode and it crashes sometimes.

BTW, the bloom effect (VERY nice in engine glows) is only working in one eye in 3DVision, but maybe it will work fine with that modification.

Very nice work indeed!

blue_max
Lieutenant JG
XWAU Member
Posts: 562
Joined: Wed Mar 20, 2019 5:12 am

Post by blue_max » Sun Dec 08, 2019 6:46 pm

Hey Darkblue, thanks for your comments!

Yes, if you disable VR mode, it will go back to the original rendering. I assume you tried setting VR_Mode = DirectSBS and that didn't work?

You're also saying that in 3Dvision you only need one image? How does 3Dvision generate both images then? From the depth buffer? Is there some documentation for this so that I can get an idea of what is needed to enable this mode?

Darkblue
Cadet 2nd Class
Posts: 87
Joined: Sun Mar 09, 2003 12:01 am

Post by Darkblue » Sun Dec 08, 2019 7:39 pm

Yes, I tried DirectSBS, and when in SBS (and 3DVision is NOT active) the HUD is perfectly rendered, no problems. But when I am still in SBS mode, I can activate 3DVision, then I get a full 3D image with each of the views (left and right), so I see 4 images, 2 + 2: for each one of these couples, the HUD is bad placed as always…(just the same I get when I launch with VRMode = None), so maybe the problem is how 3dvision drivers interpret the information.

There is some official documentation from NVIDIA (whitepapers) on 3DVision in Helixmod site, in this page: http://helixmod.blogspot.com/2014/01/le ... games.html

Also some info in 3DMigoto wiki https://github.com/bo3b/3Dmigoto/wiki and the School for shaderhackers: http://wiki.bo3b.net/index.php?title=Bo ... derhackers, although these are more focused in editing shaders to fix 3DStereo problems.

I have been using a mix of 3DMigoto and some memoryscanner techniques to fix XWA some years ago, and I got very impressive results but I failed trying to put the target CMD (the image of the targeted ship) in screen depth (2D)…so the HUD was always a problem. A very distracting problem. So the fix slept for some time until recently that I got new interest on it.

On the other hand, I think that in your fix the starfield is a bit too close (it does not seem to be at infinity) but still this is a minor problem, that I am sure could be easily fixed with some shader hacking later, if really needed. IIRC I had to push it to infinity when I fixed it, as the game, by default, places it in some place between screen plane and back plane (infinity).

blue_max
Lieutenant JG
XWAU Member
Posts: 562
Joined: Wed Mar 20, 2019 5:12 am

Post by blue_max » Mon Dec 09, 2019 7:12 pm

I've taken a look at the documentation and it looks like the easiest way to add support for 3D vision would be to piggy-back on the DirectSBS code and add the following:

https://stackoverflow.com/questions/737 ... -3d-vision

In a nutshell:

"Render left eye image
Render right eye image
Create a texture able to contain them both PLUS an extra row (so the texture size would be 2 * width, height + 1)
Write this NV_STEREO_IMAGE_SIGNATURE value
Render this texture on the screen"

The DirectSBS mode already does all the above, except for the extra row with the NV_STEREO_IMAGE_SIGNATURE. I would probably not make a new texture of size Height + 1 -- I'd just overwrite the bottom row and adjust the contents accordingly.

However, there are a couple of problems:

1. This technology seems to be deprecated (?), so no new hardware is sold/made and I don't have the hardware to test this.
2. My video card does not support 3d vision anyway -- not even with an old nVidia driver.

If you have some basic coding skills and would like to try this, I can direct you to my github page and I can give you instructions on how to compile the code. I can also point you to the right places where you would need to touch the code to add support for 3D vision.

TheLastStarfighter
Recruit
Posts: 7
Joined: Thu Dec 26, 2019 4:59 pm

Post by TheLastStarfighter » Thu Dec 26, 2019 5:06 pm

Greetings Starfighters

Love the mod, hope you continue working on it, really adds alot to the game. I'm currently running STEAM VR with a Super 2060 RTX. I'm just curious if that fish eye effect is negatable at this juncture? I have a vive. Really big props though, if you can get this game working the way Jedi Knight does with VorpX, you'll be doing well. I can code a little bit and I would be more than happy to help contribute to your project. I'm not quite sure why DICE hasn't done this yet, then again someone green lighted all of these sequels...so.... yeah. Looks like Star Wars might be solely in the realm of fans and modders for the foreseeable future.

I'm not 100% sure but are things supposed to be in 3-D or not? I saw some talk about the 6dof and was wondering if there is a setting to enable this in the new update? I'm kind of getting what looks like a flat image outside.. in VorpX this is called Z-adaptive I believe. Theres also a Geometry 3-D setting in VorpX, is that something that would be achieveable in XWA?

Apologies if this has already been answered, I looked over the previous posts but I may have missed something.

blue_max
Lieutenant JG
XWAU Member
Posts: 562
Joined: Wed Mar 20, 2019 5:12 am

Post by blue_max » Thu Dec 26, 2019 9:27 pm

Thanks for your comments, TheLastStarFighter.

The fish eye effect can be fixed; but I'm not quite sure how to do it. I think it has to do with the interaction between the in-game FOV & aspect ratio; the aspect ratio set by SteamVR and the aspect ratio set in vrparams.cfg (in a few words everything should match). I think Trevor nailed it in his latest post in this thread:

https://xwaupgrade.com/phpBB3/viewtopic ... 33#p162533

I also provided a set of coefficients to apply or substract the lens distortion effect. Look for the k1,k2 & k3 settings in vrparams.cfg and the "apply_lens_correction" setting. If you set these values to negative numbers, you'll get a pincushion effect that will compensate for the fish eye effect. You can also adjust these settings while flying using Ctrl+Alt+Arrows (Left/Right for k1 and Up/Down for k2). However, this is really just a hack and the right way to fix this is by setting the right FOV and aspect ratio.

From what I understand, our eyes cannot perceive depth from things beyond ~150 meters away. The disparity between our eyes is simply too small to notice it. That's why you'll see the cockpit in full 3D; but objects "out there" look a bit flat unless you're really close to them. I don't know enough about VorpX; but it *is* possible to selectively increase the disparity of the objects "out there". There are a few problems, though:

* The geometry breaks when crossing the limit between the cockpit and "out-there".
* When you fire lasers, they seem to come from "out of your nose", especially for small cockpits like the TIE-Fighter. Other things seem to shrink in size and "float in front of your nose" too. Which is kind of fun; but also a bit weird. If you want to see how it all looks, check these videos:

https://www.youtube.com/watch?v=zM4pbVS ... e=youtu.be
https://www.youtube.com/watch?v=BDfARGn ... e=youtu.be

* Some projection cameras for SteamVR are rotated or sheared, so I wouldn't know how to increase the disparity in these cases without introducing new artifacts or causing eye-strain. I have a PSVR, and in that case, it's just a matter of translating everything on the x-axis. For other camera models I'm guessing the "clean" way to do this would be to offset the Z component of everything "out-there"... Might as well try that later...

6dof should be enabled already, look for the "min/max_positional_track_x/y/z" and the "positional_x/y/z_multiplier" sections.

I do have plans to improve the VR experience in the future. This FOV thing is really annoying and I don't know yet how to fix it automatically. If you want to try and fix that, let me know and I'll point you in the right direction.

TheLastStarfighter
Recruit
Posts: 7
Joined: Thu Dec 26, 2019 4:59 pm

Post by TheLastStarfighter » Thu Dec 26, 2019 10:09 pm

A few more questions:

Would you say this mod works better in PSVR or Vive? I have both, I'm a bit of a super-fan.

Also is this mod capable of multiplayer with regular players? How is it that you were able to program this with just a PSVR ?

Yes I'd be happy to help with the FOV if I can.

In terms of PSVR: Astro-bot, Skyrim and Farpoint seem to have a good distance effect while the Battlefront and EVE Valkeryie 3-D is very meh. That being said, if you try Rogue Squadron for the Gamecube (the Dolphin VR) the 3-D stereoscopic effect is pretty good. Also I'm not sure if you've tried it or not but Subnautica seems to share that 'flatish' effect you are talking about. I'm not entirely sure what it is about how the gamecube games are programmed but a good number of them come out in perfect stereoscopic effect as if they were made specifically for VR.

Paper Mario TTYD
Rogue Squadron
Star Fox
Mega Man Command Mission
Battlion Wars

Same for PSP... the 3-D is really good... I'm wondering if something similar can be written for the X-Wing series.... like a graphics fork.

blue_max
Lieutenant JG
XWAU Member
Posts: 562
Joined: Wed Mar 20, 2019 5:12 am

Post by blue_max » Fri Dec 27, 2019 3:46 am

TheLastStarfighter wrote:
Thu Dec 26, 2019 10:09 pm
Would you say this mod works better in PSVR or Vive?
PSVR. SteamVR/OpenVR forces you to call a blocking function that makes you drop frames, so you always get higher FPS with PSVR.
TheLastStarfighter wrote:
Thu Dec 26, 2019 10:09 pm
Also is this mod capable of multiplayer with regular players?
I've never tried this; but I don't see why it wouldn't work. If Jeremy's ddraw works, then I think this one should too.
TheLastStarfighter wrote:
Thu Dec 26, 2019 10:09 pm
How is it that you were able to program this with just a PSVR ?
That was a stroke of pure genius my friend! :P

Well, I had people with Vive/Pimax/Oculus help me test beta versions. It took several weeks of trial-and-error and a lot of head-banging to finally figure out how to do it properly.
TheLastStarfighter wrote:
Thu Dec 26, 2019 10:09 pm
Yes I'd be happy to help with the FOV if I can.
I just sent you a PM with basic instructions to get you started on this project.
TheLastStarfighter wrote:
Thu Dec 26, 2019 10:09 pm
In terms of PSVR: Astro-bot, Skyrim and Farpoint seem to have a good distance effect while the Battlefront and EVE Valkeryie 3-D is very meh.
Well, I think this goes back to my previous point: things beyond ~150m have no disparity and thus generate no stereoscopy. During a dogfight in XWA objects tend to be around this range. However, the 3D reconstruction is also an approximation. I tried a few different scales and if you get stereoscopy for distant objects then you mess up the cockpit (it looks too small or just plain broken). In the end, I decided to use a scale that made sense in-game: objects at 2km have a Z of 2,000 and so on. Anyway, I sent you a PM with compilation instructions and I can point you in the right direction later if you want to change the VR code and try things out.

blue_max
Lieutenant JG
XWAU Member
Posts: 562
Joined: Wed Mar 20, 2019 5:12 am

Post by blue_max » Thu Jan 30, 2020 7:04 am

Alright, here's release 1.1.0 with enhanced 6dof support and a number of bug fixes:

https://www.dropbox.com/s/g4s08oxgtpu67 ... 0.zip?dl=0

boner
Cadet 4th Class
Posts: 15
Joined: Sat May 14, 2011 8:20 pm

Post by boner » Fri Jan 31, 2020 5:10 am

Hi, Works very well with freetrack (trackIR setup) with amazing plugins like Bloom effects.

i have a question about x-wing, is posible to change the model or something to see the body on the front, like on the a-wing?

you can see an expample of the problema i have with x-wing in the first minut of the video, and on the minut 2 how its Works with a-wing (the rest of the video is just a test of experimental clip and camera for freetrack, playing with gamepad :S)

https://youtu.be/Y-fbuGBMGDo

kind regards.

blue_max
Lieutenant JG
XWAU Member
Posts: 562
Joined: Wed Mar 20, 2019 5:12 am

Post by blue_max » Fri Jan 31, 2020 7:04 am

Thanks for your comments, boner, and I'm glad you're enjoying the mod (although I suggest you tone down the bloom effect a little bit).

Darksaber added the nose to the X-Wing a while ago; but I don't know if he released that OPT to the public. However, if you keep leaning outside the cockpit, we can't help you with that ;)

@Darksaber: have you released the "X-Wing with nose" somewhere?

User avatar
Trevor
Cadet 1st Class
Posts: 229
Joined: Thu Dec 04, 2014 7:11 pm

Post by Trevor » Fri Jan 31, 2020 8:43 pm

Agreed, you have wayyy too much bloom.

I would suggest disabling re-shade and just using bluemax's ddraw going forward.

ddraw has several advantages over reshade including selective bloom only allowing emissive sources to bloom.

Trev

Post Reply