XWA, Raytraced

All the XWAU recent release news from the project can be found here

Re: XWA, Raytraced

User avatar
haui
Cadet 1st Class
Posts: 122
Joined: Mon Apr 15, 2019 9:29 am
Contact:

Post by haui » Mon Jan 09, 2023 6:50 pm

Ok have a rx6600 lets See what happens
It's better to burn out than to fade away .

Bman
Lieutenant Commander
Posts: 1167
Joined: Mon Apr 05, 2004 11:01 pm

Post by Bman » Tue Jan 10, 2023 2:44 am

Nice!
W-I-P: TFTC, MC Viscount Cr., ISD-II Avenger, NL-1 Platform, Ton-Falk Esc. Cr., & Misc.

Knight26
Ensign
Posts: 293
Joined: Fri Nov 17, 2000 12:01 am

Post by Knight26 » Tue Jan 10, 2023 1:31 pm

Very cool, can't wait to see how the optimization turns out.
S. Schauer<BR>Flight Test Engineer<BR>C-17 DOOE, 418th FLTS<BR>AFFTC, Edwards AFB

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

Post by blue_max » Tue Jan 10, 2023 5:29 pm


Kampher
Cadet 2nd Class
Posts: 79
Joined: Tue May 09, 2006 11:01 pm

Post by Kampher » Wed Jan 11, 2023 5:37 pm

This is incredible! Thank you, blue_max.

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

Post by keiranhalcyon7 » Thu Jan 12, 2023 8:07 am

<rocket>
Oh...
...yeah
</rocket>

Erd
Cadet 3rd Class
Posts: 32
Joined: Mon Dec 17, 2018 10:11 am

Post by Erd » Thu Jan 12, 2023 9:33 pm

I just noticed the speed readout gets cut off when it becomes three figures. A quibble for the next patch, no doubt.

Knarfe
Cadet 3rd Class
Posts: 42
Joined: Mon Feb 01, 2021 1:03 pm

Post by Knarfe » Wed Jan 18, 2023 8:43 am

Superb work so far! Grafic cards of the RTX 2000 generation shouldn´t have problems with this, right? Like framedrops below 60 FPS or so.

I hope for a migration to Direct X 12 though.

User avatar
Vince T
Fleet Admiral (Administrator)
Posts: 14045
Joined: Fri Apr 27, 2001 11:01 pm
Contact:

Post by Vince T » Wed Jan 18, 2023 5:10 pm

I got to test it on a RTX 3070 and while there definitely is a bit performance loss compared to playing without RT I hardly experienced any dips below 100 FPS, even with HD models like the new ISD, running at 3440x1440. Still, depending on what‘s on screen I‘m still getting peaks of 200 FPS and more
9E73A18C-49E7-48B0-80F4-1F79926EF409.png
You do not have the required permissions to view the files attached to this post.
Your ship, Captain. I need a drink. - Vince Trageton
Vince T's X-Wing HQ - where the bad guys get their gear

Kampher
Cadet 2nd Class
Posts: 79
Joined: Tue May 09, 2006 11:01 pm

Post by Kampher » Thu Jan 19, 2023 12:17 am

That looks incredible. I can't wait to jump in and play with all the new bells and whistles (especially the new ISD's).

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

Post by keiranhalcyon7 » Thu Jan 19, 2023 2:14 am

Hmm, note for blue_max - in Vince's image above, given the sun angle, the entire engine bay should be in shadow, should it not? Forgive me if my terms are inaccurate, but it looks like the albedo is obeying the shadows, but the specular is not. (See also the gradient on the portion of the uppermost deck in the shadow of the "neck".)

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

Post by blue_max » Thu Jan 19, 2023 5:10 pm

keiranhalcyon7 wrote:
Thu Jan 19, 2023 2:14 am
Hmm, note for blue_max - in Vince's image above, given the sun angle, the entire engine bay should be in shadow, should it not? Forgive me if my terms are inaccurate, but it looks like the albedo is obeying the shadows, but the specular is not. (See also the gradient on the portion of the uppermost deck in the shadow of the "neck".)
It also depends on how many light sources there were in this map. Planets and nebulae also emit light, but only the suns will cast shadows (I can have multiple shadow casters, but not only does it look very weird, it also incurs an additional performance penalty). So yes, the engine area should be in shadow, as you pointed out, but I'm guessing there's another light source off-screen here.

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

Post by blue_max » Thu Jan 19, 2023 7:15 pm

Alright, enough waiting! Here's a preview of this effect:


EDIT: Link removed, see the last post for the latest update.


Real-time Screen-Space Raytracing is finally here for XWA!

RT is disabled by default. To enable it, you can press Ctrl+R while flying. After that, you can enable Raytraced Cockpit Shadows by pressing Ctrl+Shift+R, in that order.

Raytracing can also be enabled by adding the following to SSAO.cfg:

Code: Select all

raytracing_enabled = 1
raytracing_enabled_in_tech_room = 1
raytracing_enabled_in_cockpit = 1
HDR_lights_intensity = 2.0
Please note that enabling Raytraced Cockpit Shadows incurs a noticeable impact in performance.

RT uses a new shader that also implements HDR. To control the brightness when RT is on, you can use the HDR_lights_intensity setting. Higher values make brighter scenes and viceversa. RT also responds to the "ambient" setting in SSAO.cfg: I suggest you use a value between 0.03 and 0.05.

Known Issues:

* The Raytracer uses more GPU memory. So I'm pretty sure it will crash on larger battles.
* This feature is meant for higher-end systems, but I can run it on my old nVidia 1070 (laptop version) at a playable framerate (my average is about 40fps). Still, expect a noticeable impact (without RT my average is around 80fps). This is the first version of this feature, so expect better performance in future updates.
* This is Screen-Space RT. Which means that whenever a new mesh enters the screen, there will be a brief pause while the engine builds the new acceleration structure needed for it. This also means that meshes that exit the screen will no longer cast shadows. This may cause some flicker. This is most noticeable in the cockpit, when looking around: you'll see new shadows pop in an out as their corresponding mesh gets rendered (or not).
* Materials may look a bit different with RT. I've noticed that the biggest change comes from the glossiness setting. Feel free to experiment!
Last edited by blue_max on Tue Jan 24, 2023 10:11 am, edited 1 time in total.

korekwerner
Cadet 1st Class
Posts: 154
Joined: Wed Mar 20, 2019 7:04 pm

Post by korekwerner » Thu Jan 19, 2023 8:52 pm

Time for testing :-).
After short tests I can say that it is brilliant :-). As I can see, almost all textures need some tweaking in the material library, I think I'm going to have a lot of optimizations to do with that. If ddraw improves its performance in computing polygons, textures may be less detailed. I see we're getting closer to XWVM, however XWA has hyperspace jumps :-)
Thank you.

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

Post by blue_max » Thu Jan 19, 2023 9:37 pm

korekwerner wrote:
Thu Jan 19, 2023 8:52 pm
As I can see, almost all textures need some tweaking in the material library, I think I'm going to have a lot of optimizations to do with that.
I wouldn't do that just yet as I'm still trying to match the current look as much as possible to avoid precisely this sort of thing. But if you want to make some light adjustments, then sure, go ahead.

User avatar
MechDonald
XWAU Member
Posts: 577
Joined: Mon Jul 26, 2021 1:21 pm

Post by MechDonald » Thu Jan 19, 2023 10:48 pm

Oh WOW! This is something i always wanted for XWA!!! I never thought that this will ever be reality. I played some Missions and it's sooo amazing now!! How ships fly into shadows of other ships - it looks so cool now!

Thank you very, very much for the awesome work @blue_max!! I'm so happy now! :gott:

batuta
Cadet 1st Class
Posts: 155
Joined: Tue Oct 13, 2020 1:34 pm

Post by batuta » Fri Jan 20, 2023 12:08 am

Thank you very much blue max, your work is incredible.

marcop000
Cadet 1st Class
Posts: 213
Joined: Fri Dec 27, 2019 7:08 pm

Post by marcop000 » Fri Jan 20, 2023 2:04 pm

Do you have the plan to add ray tracing to all ships ? if is yes I suppose will be a very long and hard work ....

To prevent accessive FPS drop have thinked about ray tracing custom level ? (Low, mid , high, ultra)

So instead of disable it for default you can enable on "low" and allow how have cheap video card (ex. GTX 1060) to use it without too performace hit.

User avatar
Vince T
Fleet Admiral (Administrator)
Posts: 14045
Joined: Fri Apr 27, 2001 11:01 pm
Contact:

Post by Vince T » Fri Jan 20, 2023 2:39 pm

marcop000 wrote:
Fri Jan 20, 2023 2:04 pm
Do you have the plan to add ray tracing to all ships ? if is yes I suppose will be a very long and hard work ....
This is nothing ship-specific, it does apply to all 3d objects.
Your ship, Captain. I need a drink. - Vince Trageton
Vince T's X-Wing HQ - where the bad guys get their gear

Hullbreacher
Rebel Alliance
Posts: 96
Joined: Thu Jul 20, 2006 11:01 pm

Post by Hullbreacher » Fri Jan 20, 2023 3:08 pm

hey so this is incredible!!! I can't wait to try it out! Thanks Blue for all your incredible work!!!!!
Ackbar: "IT'S A TRAP!!"
Kids: "ADMIRAL ACKBAR CEREAL!!"
Ackbar: "YOUR TASTE BUDS CAN'T REPEL FLAVOR OF THAT MAGNITUDE!"

Muahaha
Cadet 3rd Class
Posts: 29
Joined: Thu May 13, 2021 4:45 am

Post by Muahaha » Fri Jan 20, 2023 3:39 pm

Tested and run a couple of missions, seems pretty smooth and getting responsive fps. The ingame scenes are so pretty.

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

Post by blue_max » Fri Jan 20, 2023 5:51 pm

Thanks for your comments guys. Everything casts Raytraced shadows at this moment, but I'm considering adding a new material setting to de-activate Raytracing for specific areas of an OPT. For instance, in the Training Missions or the DS2 level you actually go inside a big structure where everything is in complete shadow all the time, so it makes no sense to do Raytracing in these areas. This setting can also be used to implement "low/high" Raytracing settings.

Regarding the performance issues, we have a plan to use Embree in the near future. That should improve the framerate :)

User avatar
MechDonald
XWAU Member
Posts: 577
Joined: Mon Jul 26, 2021 1:21 pm

Post by MechDonald » Fri Jan 20, 2023 6:08 pm

For me it seems, that not all missions have shadow-casting. Although there is a light source in the scene, there are no shadows. I experienced this in the mission where i have to rescue Emon with the Otana.
The area where i have to pick up the bomb-container is just flat dark. And the next area is missing all the beautiful shadows. Is there something wrong with my installation? (I reinstalled XWA + Upgrade just yesterday).

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

Post by blue_max » Fri Jan 20, 2023 10:19 pm

MechDonald wrote:
Fri Jan 20, 2023 6:08 pm
For me it seems, that not all missions have shadow-casting. Although there is a light source in the scene, there are no shadows. I experienced this in the mission where i have to rescue Emon with the Otana.
The area where i have to pick up the bomb-container is just flat dark. And the next area is missing all the beautiful shadows. Is there something wrong with my installation? (I reinstalled XWA + Upgrade just yesterday).
I don't think there's anything wrong with your installation. Some areas have low lighting conditions, so the shadows are barely visible. For instance, in B1M3, region 4, there's almost no shadows. I checked B1M3 and the sun in this region was configured to have low illumination. In other words, that's a decision made by the mission designers. I can override that and force brighter suns, but I know there's some missions that are intentionally dark. I doubt the developers from 20 years ago noticed this, though.

Can you send me a film of this region, please? I can take a look to see if maybe there's a bug that needs to be fixed.

MamiyaOtaru
Cadet 4th Class
Posts: 18
Joined: Mon Nov 04, 2019 4:17 am

Post by MamiyaOtaru » Sat Jan 21, 2023 1:39 am

expected that my own ship doesn't really cast a shadow unless I am in external view?

With ray traced cockpit shadows on I do cast a bit of a shadow but I suspect it is of the cockpit model itself and not my ship! Nothing when I am using shadowmapping in the cockpit but raytracing otherwise.

Beyond that, works great! I'd dreamed about this becoming possible

Post Reply