New High-Res Hyperspace Effect
Re: New High-Res Hyperspace Effect
- Vince T
- Posts: 14052
- Joined: Fri Apr 27, 2001 11:01 pm
- Contact:
This looks really great! Amazing work!
Your ship, Captain. I need a drink. - Vince Trageton
Vince T's X-Wing HQ - where the bad guys get their gear
Vince T's X-Wing HQ - where the bad guys get their gear
W-I-P: TFTC, MC Viscount Cr., ISD-II Avenger, NL-1 Platform, Ton-Falk Esc. Cr., & Misc.
- ual002
- Posts: 983
- Joined: Wed Sep 24, 2008 2:23 am
Throw up some youtube examples of the turret and everything at its current state. I haven't had the chance to boot up XWA in a while.
- blue_max
- Posts: 2296
- Joined: Wed Mar 20, 2019 5:12 am
https://www.youtube.com/watch?v=XVnSaFf ... e=youtu.be
@keiranhalcyon7: I wouldn't say I "nailed it" a 100% since the perspective of the effect is a bit off. This can't be noticed unless the camera moves around; but that needs to be fixed. BTW, does anyone know where XWA stores the current camera matrix? Or the FOV/focal depth? I will probably need that information to fix the perspective of the effect.
- keiranhalcyon7
- Posts: 599
- Joined: Tue Jan 02, 2018 6:41 am
I think that's the wrong tunnel effect.
I noticed some rather heavy barrel distortion on shadertoy. XWA appears to have some as well, but it's more subtle. Could that be the difference? The distortion levels would need to be matched to look convincing. (FOV too, of course.)
I noticed some rather heavy barrel distortion on shadertoy. XWA appears to have some as well, but it's more subtle. Could that be the difference? The distortion levels would need to be matched to look convincing. (FOV too, of course.)
- blue_max
- Posts: 2296
- Joined: Wed Mar 20, 2019 5:12 am
@ual002 Thanks!
@keiranhalcyon7: I double-checked and I think the tunnel is your code. It may look a bit different because I added bloom and maybe the speed is also not exactly the same.
AFAIK there's always some amount of barrel distortion to be expected from the pinhole camera model. In this case I fixed the problem by adjusting what would be the equivalent of the FOV (which also changes how much distortion we see near the edges of the screeen); but I honestly don't understand the values that I ended up using, and I don't like the fact that right now it's trial-and-error. Maybe it's a combination of FOV, HUD scale, in-game aspect ratio and screen aspect ratio?
Does anyone know what the HUD scale is used for? I thought it was only relevant when rendering the HUD, not the 3D content. Also, would anyone know where the game stores HUD scale and FOV? I'm about to publish a preview so I can share this puzzle with you guys
@keiranhalcyon7: I double-checked and I think the tunnel is your code. It may look a bit different because I added bloom and maybe the speed is also not exactly the same.
AFAIK there's always some amount of barrel distortion to be expected from the pinhole camera model. In this case I fixed the problem by adjusting what would be the equivalent of the FOV (which also changes how much distortion we see near the edges of the screeen); but I honestly don't understand the values that I ended up using, and I don't like the fact that right now it's trial-and-error. Maybe it's a combination of FOV, HUD scale, in-game aspect ratio and screen aspect ratio?
Does anyone know what the HUD scale is used for? I thought it was only relevant when rendering the HUD, not the 3D content. Also, would anyone know where the game stores HUD scale and FOV? I'm about to publish a preview so I can share this puzzle with you guys
- keiranhalcyon7
- Posts: 599
- Joined: Tue Jan 02, 2018 6:41 am
Easy way to check: Is that the tunnel with the Perlin noise or the Simplex noise? It looks like the Perlin noise to me.
FOV is a user parameter, so it needs to be read from the game state. The address is 0x91AB6C (four byte integer). I think its meaning is something like "distance of rendered image plane to camera, in pixels", if that makes sense.
HUD scale, as you thought, is only used for the 2d HUD elements. It's a scale factor for the bitmaps, and it's used in an if/else tree to pick between three pre-rendered font sizes.
FOV is a user parameter, so it needs to be read from the game state. The address is 0x91AB6C (four byte integer). I think its meaning is something like "distance of rendered image plane to camera, in pixels", if that makes sense.
HUD scale, as you thought, is only used for the 2d HUD elements. It's a scale factor for the bitmaps, and it's used in an if/else tree to pick between three pre-rendered font sizes.
- Rookie_One1
- Posts: 1657
- Joined: Thu Feb 26, 2004 12:01 am
still it's looking good, better than what we had originally in-game
That said I don't know enough about OPTing to modify the turret arcs so that it point correctly, someone else will have to do it
Just check how the gun turret is attached to the rest of the ship, technically speaking, when you look at it on how it's installed, from outside versus from inside, the "bottom" of the turret when looking from inside should be pointing toward the front of the ship....at least on the YT-1300 and the YT-2000blue_max wrote: ↑Tue Dec 10, 2019 12:53 amCould you please elaborate a little bit on this point? I'm using the YT-1300 Corellian Transport from Prologue Mission 2 to test this, and I noticed that the "horizon" is rotated by 90 degrees with respect to the cockpit. Is that what you mean here? If I understand correctly, the turret is the one on top of the YT-1300; but I could be wrong (Is it on the side? Or the bottom?)
That said I don't know enough about OPTing to modify the turret arcs so that it point correctly, someone else will have to do it
Rookie One, is that you?? - Ru Merleen, Rebel Spy at Imdaar Alpha
Current Holder of the Frying Pan of Death
Current Holder of the Frying Pan of Death
- blue_max
- Posts: 2296
- Joined: Wed Mar 20, 2019 5:12 am
Thanks Rookie_One1! Here's another short clip with a small surprise:
https://www.youtube.com/watch?v=2tUNBIn ... e=youtu.be
@keiranhalcyon7: This is the tunnel with 3D simplex noise and twirl; but I did have to adjust the speed a little bit. It has your fix to avoid the seams too. Thanks for the information! Is the FOV a float value? I've seen xwahacker say things like "83.26" for the FOV. I'll have to check and see what makes sense. In the meantime, I need to write a small tutorial on how to adjust the effect...
https://www.youtube.com/watch?v=2tUNBIn ... e=youtu.be
@keiranhalcyon7: This is the tunnel with 3D simplex noise and twirl; but I did have to adjust the speed a little bit. It has your fix to avoid the seams too. Thanks for the information! Is the FOV a float value? I've seen xwahacker say things like "83.26" for the FOV. I'll have to check and see what makes sense. In the meantime, I need to write a small tutorial on how to adjust the effect...
- blue_max
- Posts: 2296
- Joined: Wed Mar 20, 2019 5:12 am
To fix the hyperspace effect I had to add two parameters: "y_center" and "FOV_scale". The first one moves the effect vertically so it can be aligned with the crosshairs, and the second one is a general "scale". I've also added a debug mode to adjust these values. This is how you they can be adjusted:
Start with y_center. This is what it looks like with y_center set to 0, the center of the effect doesn't match the crosshairs:
With a little trial-and-error it can be adjusted vertically with y_center to look like this:
Start with y_center. This is what it looks like with y_center set to 0, the center of the effect doesn't match the crosshairs:
With a little trial-and-error it can be adjusted vertically with y_center to look like this:
You do not have the required permissions to view the files attached to this post.
- keiranhalcyon7
- Posts: 599
- Joined: Tue Jan 02, 2018 6:41 am
To clarify, when you're in a turret on the Corellian transports, the turret mounting is "above" you. In the exterior model, the turret mounting is to the aft. But if you fire "up", you're firing to starboard, not aft.Rookie_One1 wrote: ↑Tue Dec 17, 2019 6:32 amJust check how the gun turret is attached to the rest of the ship, technically speaking, when you look at it on how it's installed, from outside versus from inside, the "bottom" of the turret when looking from inside should be pointing toward the front of the ship....at least on the YT-1300 and the YT-2000
That said I don't know enough about OPTing to modify the turret arcs so that it point correctly, someone else will have to do it
The value is an int, such that, I think,blue_max wrote: ↑Tue Dec 17, 2019 6:46 am@keiranhalcyon7: This is the tunnel with 3D simplex noise and twirl; but I did have to adjust the speed a little bit. It has your fix to avoid the seams too. Thanks for the information! Is the FOV a float value? I've seen xwahacker say things like "83.26" for the FOV. I'll have to check and see what makes sense. In the meantime, I need to write a small tutorial on how to adjust the effect...
Code: Select all
resolution_height/2/fov_var = tan(real_vertical_fov_radians/2)
Last edited by keiranhalcyon7 on Tue Dec 17, 2019 7:17 am, edited 2 times in total.
- blue_max
- Posts: 2296
- Joined: Wed Mar 20, 2019 5:12 am
Next, enable mouse look and move the camera towards the edge of the screen -- any edge. This is what it looks like with "FOV_scale" set to 1.0:
Again, after a little trial-and-error, the effect matches the crosshairs:
I hope this is just a temporary thing while I figure out how to adjust these parameters automatically.
Again, after a little trial-and-error, the effect matches the crosshairs:
I hope this is just a temporary thing while I figure out how to adjust these parameters automatically.
You do not have the required permissions to view the files attached to this post.
- blue_max
- Posts: 2296
- Joined: Wed Mar 20, 2019 5:12 am
Thanks! I'll see if I can make sense of all this with this bit of information.keiranhalcyon7 wrote: ↑Tue Dec 17, 2019 6:56 amThe value is an int, such that, I think, resolution_height/2/fov_var = tan(real_vertical_fov_radians/2)
- keiranhalcyon7
- Posts: 599
- Joined: Tue Jan 02, 2018 6:41 am
I'll note that this is different from the formula that reimar used in xwahacker. There, the factor of 1/2 is omitted on the left, resulting in degree values in the 80s, which I've always thought seemed high. With the factor of 1/2, the degree values for the TG resolutions are around 50, which seems more reasonable to me (and also jives with my understanding of the underlying geometry).blue_max wrote: ↑Tue Dec 17, 2019 7:03 amThanks! I'll see if I can make sense of all this with this bit of information.keiranhalcyon7 wrote: ↑Tue Dec 17, 2019 6:56 amThe value is an int, such that, I think,Code: Select all
resolution_height/2/fov_var = tan(real_vertical_fov_radians/2)
- blue_max
- Posts: 2296
- Joined: Wed Mar 20, 2019 5:12 am
And here it is, the preview of this effect:
https://www.dropbox.com/s/v7ivkuny6le2c ... w.zip?dl=0
To install it, you'll need the VR mod, version 1.0.9 from here:
https://www.dropbox.com/s/zphae74s8y45c ... 9.zip?dl=0
and just overwrite the files from the first ZIP file on top of it. The installer also includes a tweaked version of the cockpit look hook (it is now possible to look around while in hyperspace). Oh, and I've added yet another config file for this effect.
This isn't fully-tested yet and I just noticed one bug a few minutes ago. Also, the effect won't work in any VR mode; but it does work on the regular mode.
https://www.dropbox.com/s/v7ivkuny6le2c ... w.zip?dl=0
To install it, you'll need the VR mod, version 1.0.9 from here:
https://www.dropbox.com/s/zphae74s8y45c ... 9.zip?dl=0
and just overwrite the files from the first ZIP file on top of it. The installer also includes a tweaked version of the cockpit look hook (it is now possible to look around while in hyperspace). Oh, and I've added yet another config file for this effect.
This isn't fully-tested yet and I just noticed one bug a few minutes ago. Also, the effect won't work in any VR mode; but it does work on the regular mode.
- blue_max
- Posts: 2296
- Joined: Wed Mar 20, 2019 5:12 am
Good to know! You just saved me a couple of hours of wondering just what was going onkeiranhalcyon7 wrote: ↑Tue Dec 17, 2019 7:17 amI'll note that this is different from the formula that reimar used in xwahacker. There, the factor of 1/2 is omitted on the left, resulting in degree values in the 80s,
- Trevor
- Posts: 541
- Joined: Thu Dec 04, 2014 7:11 pm
Why does 80 sound high for FOV?keiranhalcyon7 Tue Dec 17, 2019 07:17 wrote: xwahacker. There, the factor of 1/2 is omitted on the left, resulting in degree values in the 80s, which I've always thought seemed high. With the factor of 1/2, the degree values for the TG resolutions are around 50, which seems more reasonable to me
Default FOV for Anim8or is 60, GoldenEye is 75 and the FOV for the Occulus is 110
If you could play XWA in another headset there is even one with an FOV of 180 (ok, that's horizontal FOV which XWA uses vertical which brings that headset back down to the 110 mark)
Trev
- keiranhalcyon7
- Posts: 599
- Joined: Tue Jan 02, 2018 6:41 am
I look at the game, and I don't "buy" that I'm getting nearly 90 degrees of vertical fov. Also, the math makes more sense, as I indicated above.
- Darksaber
- Posts: 10931
- Joined: Mon Jan 10, 2000 12:01 am
- Contact:
Not tried it yet but it looks great, I'm going to wait for someone to figure out the HUD and Crosshair for 1920x1080 cheers though
“You can please some of the people all of the time, you can please all of the people some of the time, but you can’t please all of the people all of the time”.”
- John Lydgate
Good Things Come To Those Who Wait....
Darksaber's X-Wing Station
- John Lydgate
Good Things Come To Those Who Wait....
Darksaber's X-Wing Station
- JeremyaFr
- Posts: 3989
- Joined: Mon Jan 18, 2010 5:52 pm
- Contact:
Hello,
Here is the involved variables in the game. I've included a bunch of values that can be used.
In function L0050A7E0:
In function L0050FCB0:
Replace GetSystemMetrics( SM_CXSCREEN ) and GetSystemMetrics( SM_CYSCREEN ) by the width and height that you want to use.
Here is the involved variables in the game. I've included a bunch of values that can be used.
In function L0050A7E0:
Code: Select all
int s_XwaFlightScreenWidth (0x0091AD34) = GetSystemMetrics( SM_CXSCREEN );
int s_XwaFlightScreenHeight (0x0091AD3C) = GetSystemMetrics( SM_CYSCREEN );
int s_XwaFlightSurfaceWidth (0x006002B0) = GetSystemMetrics( SM_CXSCREEN );
int s_XwaFlightSurfaceHeight (0x006002B4) = GetSystemMetrics( SM_CYSCREEN );
int s_V0x05FFDB4 = GetSystemMetrics( SM_CXSCREEN );
Code: Select all
float s_XwaHudScale (0x006002B8) = (float)GetSystemMetrics( SM_CYSCREEN ) / 600.0f;
int s_V0x091AB6C = (int)( (float)GetSystemMetrics( SM_CYSCREEN ) * 1.0666f + 0.5f );
int s_V0x07B33CC = s_V0x091AB6C / 2;
float s_V0x07D4B78 = s_XwaHudScale * 1.25f;
“You can please some of the people all of the time, you can please all of the people some of the time, but you can’t please all of the people all of the time”.”
- John Lydgate
Good Things Come To Those Who Wait....
Darksaber's X-Wing Station
- John Lydgate
Good Things Come To Those Who Wait....
Darksaber's X-Wing Station
- JeremyaFr
- Posts: 3989
- Joined: Mon Jan 18, 2010 5:52 pm
- Contact:
For 1920x1080:
HUD scale:
value: 1080 / 600.0f = 1.8
FOV:
value: 1080 * 1.0666f + 0.5f = 1152
angle: atan(1080 / 1152) * 2 / pi * 180 = 86.3°
HUD scale:
value: 1080 / 600.0f = 1.8
FOV:
value: 1080 * 1.0666f + 0.5f = 1152
angle: atan(1080 / 1152) * 2 / pi * 180 = 86.3°