PREVIEW: Effects ddraw 2.0 with enhanced GPU support

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

PREVIEW: Effects ddraw 2.0 with enhanced GPU support

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

Post by blue_max » Mon Jan 24, 2022 8:06 pm

UPDATE (Feb 4, 2022): SteamVR is now supported. PLEASE TAKE CARE OF YOUR EYES! There's a chance that this version may display blurry images or even double vision in VR. If you experience these problems, stop playing immediately and revert to the old version of ddraw.dll!

There's also some fixes for the regular version:
* Hangar shadows have been fixed
* Engine glow for distant objects should not flicker anymore
* Improved precision for distant objects (again, flickering should be less pronounced)

UPDATE (Feb 14, 2022): Only minor fixes.
* Lines in map mode are drawn at the right depth, making the map more readable.
* Minor fixes to the lights and shading.

UPDATE (Feb 25, 2022):
* The hangar shadow system has been rewritten. The new shadows should solve a number of reported artifacts and the VR performance should be better in the hangar.

* UPDATE (Feb 28, 2022):
* Several fixes to the Tech Room, including geometry corruption and loading times.
* The Tech Room now renders OPTs using a PBR-based shader.

* UPDATE (Mar 1, 2022):
* Restored HUD animations
* Enabled backface culling (got a ~10% improvement in performance)

* UPDATE (Mar 3, 2022):
* Fixed artifacts that made the screen go black when looking at the Sun.

* UPDATE (Mar 8, 2022):
* Added scissor rect (the CMD display should no longer spill over).
* Fixes to the animated HUD transparency while in hyperspace.

* UPDATE (Mar 10, 2022):
* Fixed black cockpit glass when jumping into hyperspace.
* Fixed missing cockpit areas in SteamVR (by disabling backface culling). This can be re-enabled in DDraw.cfg by adding CullBackFaces = 1

* UPDATE (Mar 12, 2022):
* The cockpit won't be clipped anymore in VR mode.

* UPDATE (Mar 22, 2022):
* New tracking hooks by m0rgg that enable full 6dof in the hangar and gunner turrets in SteamVR mode.
* Please set "pose_corrected_headtracking = 0" in CockpitLook.cfg for this version, otherwise you may experience several artifacts.

* UPDATE (Mar 27, 2022):
* Fixed laser reticle pips. FIxed spurious shadows for the YT family. Fixed holographic displays in the hangar in VR.

* UPDATE (Mar 29, 2022):
* More fixes to the laser reticle pips by m0rgg.
* Fixes to the HUD display when the camera is in exterior view mode.

* UPDATE (Apr 6, 2022):
* Enabled DirectSBS mode.
* Added Normal Mapping. Activate in the material files by adding "NormalMap = <path-to-file.dat>-<GroupId>-<ImageId>" under the relevant texture sections.
* Normal Mapping may take a few seconds to load and it can be toggled with Ctrl+Alt+N
* Minor fixes to the Tech Room.
* Bumped version to 2.0. The files can now be downloaded from the Downloads section in this forum.

* UPDATE (May 3, 2022):
There's only fixes in version 2.0.1, no new features.
* Fixed clipping problems in the CMD.
* The Dynamic Cockpit now works even when shading is disabled.
* Fixed intermittent problems with Bloom.
* Broken glass in the cockpit should now look fine.

Thanks to @JeremyaFr we now have an experimental set of hooks that allows us to offload most of the 3D work from the CPU to the GPU. This means that almost all the 3D computations are now performed in parallel -- with a corresponding increase in performance.

You'll need to do some setup for this version. In DDraw.cfg, you'll need to add the following:

Code: Select all

; D3dRendererHookEnabled = 0 (no) or 1 (yes)
D3dRendererHookEnabled = 1
In hooks.ini, make sure you set IsHookD3DEnabled to 0:

Code: Select all

[hook_d3d]
IsHookD3DEnabled = 0
Now, rename your existing ddraw.dll to ddraw.old, and your Hook_CockpitLook.dll to Hook_CockpitLook.old and download the new versions from the ZIP file below:

NOTE: Please set "pose_corrected_headtracking = 0" in your CockpitLook.cfg for this version. Otherwise you might experience several display artifacts.

LINK REMOVED. Please download the latest ddraw-2.0 from the Downloads section from now on.

If you'd like to revert the changes, rename ddraw.dll to ddraw.new and then rename ddraw.old to ddraw.dll. Do the same with Hook_CockpitLook.dll.
You can't have two ddraw/Hook_CockpitLook DLLs on the same directory (even if they have different names). So it's important that the extension is changed from DLL to something else.

Finally, feel free to report any artifacts or bugs you may experience.

Known issues:
* Missing holographic displays while parked in the hangar in SteamVR mode.
* Very low FPS in certain situations (we're still investigating this)
* The DS2 mission is broken in VR
* DirectSBS mode is still broken
Last edited by blue_max on Wed May 04, 2022 6:58 am, edited 22 times in total.

Rookie_One1
Rebel Alliance
Posts: 1599
Joined: Thu Feb 26, 2004 12:01 am

Post by Rookie_One1 » Mon Jan 24, 2022 8:35 pm

Well that should be interesting
Rookie One, is that you?? - Ru Merleen, Rebel Spy at Imdaar Alpha
Current Holder of the Frying Pan of Death

User avatar
Forceflow
Fleet Admiral (Administrator)
Posts: 6787
Joined: Wed Oct 20, 1999 11:01 pm
Contact:

Post by Forceflow » Mon Jan 24, 2022 8:37 pm

I gave this a spin earlier and it feels SOOOO much better. I can highly suggest everyone to try this out!
Murphy was an optimist! I am a pessimist!
And always remember that a smile is cheaper than a bullet! (District 9)
Webmaster of the X-Wing Alliance Upgrade Project

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

Post by Kampher » Mon Jan 24, 2022 9:10 pm

This is a game changer. Thank you so much for this.

BadWookiee
Cadet 4th Class
Posts: 19
Joined: Wed Apr 15, 2020 10:18 pm

Post by BadWookiee » Mon Jan 24, 2022 10:16 pm

Just for clarification, how does this change how the game is played? In laymans terms, what does it do?

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

Post by blue_max » Mon Jan 24, 2022 10:32 pm

BadWookiee wrote:
Mon Jan 24, 2022 10:16 pm
Just for clarification, how does this change how the game is played? In laymans terms, what does it do?
Makes the game more playable and the experience is much smoother. It also makes better use of your GPU.

In the old version, you may experience that the game stutters when the screen is busy. In this version, this is less likely to happen (it's not impossible, just less likely to happen). Your frames-per-second should be better now and there should be less drops in the framerate.

BadWookiee
Cadet 4th Class
Posts: 19
Joined: Wed Apr 15, 2020 10:18 pm

Post by BadWookiee » Mon Jan 24, 2022 10:43 pm

blue_max wrote:
Mon Jan 24, 2022 10:32 pm
BadWookiee wrote:
Mon Jan 24, 2022 10:16 pm
Just for clarification, how does this change how the game is played? In laymans terms, what does it do?
Makes the game more playable and the experience is much smoother. It also makes better use of your GPU.

In the old version, you may experience that the game stutters when the screen is busy. In this version, this is less likely to happen (it's not impossible, just less likely to happen). Your frames-per-second should be better now and there should be less drops in the framerate.
Yea I have been experiencing that particular event and it is annoying, even though I have a 500gb SSD and 16bg RAM installed

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

Post by keiranhalcyon7 » Mon Jan 24, 2022 10:48 pm

BadWookiee wrote:
Mon Jan 24, 2022 10:43 pm
Yea I have been experiencing that particular event and it is annoying, even though I have a 500gb SSD and 16bg RAM installed
It's not really a RAM or SSD issue. XWA is single-threaded, because that's the era it's from. When there's a lot of geometry to process, even modern CPUs can become bottlenecked, because modern CPUs derive their performance gains largely from adding more cores, which XWA cannot use. This enhancement moves the geometry processing from the CPU to the GPU, which is massively parallel and designed to handle lots of geometry, so the CPU has a lot less to choke on.

Calmputer
Cadet 3rd Class
Posts: 34
Joined: Thu Jun 25, 2020 2:04 pm
Contact:

Post by Calmputer » Mon Jan 24, 2022 10:50 pm

I've only experienced a few hiccups while playing up until now... I think most famously the first TIE assault in the first phase of the Battle of Yavin (Edit: ENDOR)
I tried it again just now with this update and it's as smooooth as butter.
Computer: I7-9700K (32Gb RAM) + RTX 2070 (8Gb RAM)

Seriously, awesome work... and a question: how is this even possible?! I remember the original game required DirectX 3, and only supported I think Voodoo graphics cards? Are there enough similarities between Dx3 and the modern version of DirectX, or did you make it work in some other way?
Last edited by Calmputer on Mon Jan 24, 2022 11:32 pm, edited 1 time in total.

BadWookiee
Cadet 4th Class
Posts: 19
Joined: Wed Apr 15, 2020 10:18 pm

Post by BadWookiee » Mon Jan 24, 2022 11:10 pm

Calmputer wrote:
Mon Jan 24, 2022 10:50 pm
I've only experienced a few hiccups while playing up until now... I think most famously the first TIE assault in the first phase of the Battle of Yavin.
I tried it again just now with this update and it's as smooooth as butter.
Computer: I7-9700K (32Gb RAM) + RTX 2070 (8Gb RAM)

Seriously, awesome work... and a question: how is this even possible?! I remember the original game required DirectX 3, and only supported I think Voodoo graphics cards? Are there enough similarities between Dx3 and the modern version of DirectX, or did you make it work in some other way?
How did you manage to get the Battle of Yavin?

Calmputer
Cadet 3rd Class
Posts: 34
Joined: Thu Jun 25, 2020 2:04 pm
Contact:

Post by Calmputer » Mon Jan 24, 2022 11:31 pm

BadWookiee wrote:
Mon Jan 24, 2022 11:10 pm
How did you manage to get the Battle of Yavin?
Sorry... Battle of Endor.
it's past midnight here.

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

Post by blue_max » Mon Jan 24, 2022 11:44 pm

Calmputer wrote:
Mon Jan 24, 2022 10:50 pm
Seriously, awesome work... and a question: how is this even possible?!
The game still thinks it's running on DirectX 5 (I think that's the version it was coded for). However, the DirectX 5 implementation we're providing in ddraw translates DX5 into DX11 commands. That's how the game still runs on modern hardware.

More specifically, Jeremy figured out how the 3D geometry was being processed by the game and then redirected the flow so that it skips the regular processing and now the 3D data is sent to the GPU. This required some serious reverse-engineering skills (and patience!) from Jeremy.

BadWookiee
Cadet 4th Class
Posts: 19
Joined: Wed Apr 15, 2020 10:18 pm

Post by BadWookiee » Mon Jan 24, 2022 11:52 pm

blue_max wrote:
Mon Jan 24, 2022 8:06 pm
Thanks to @JeremyaFr we now have an experimental set of hooks that allows us to offload most of the 3D work from the CPU to the GPU. This means that almost all the 3D computations are now performed in parallel -- with a corresponding increase in performance.

Please, bear in mind that this version is still experimental: you're likely to see artifacts and there's no VR support yet. However, I think it's relatively stable and the increase in performance is substantial, so I'd like to share this preview with the community.

But first, you'll need to do some setup. In DDraw.cfg, you'll need to add the following:

Code: Select all

; D3dRendererHookEnabled = 0 (no) or 1 (yes)
D3dRendererHookEnabled = 1
In hooks.ini, make sure you set IsHookD3DEnabled to 0:

Code: Select all

[hook_d3d]
IsHookD3DEnabled = 0
Now, rename your existing ddraw.dll to ddraw.old, and download the new version from this link:

https://www.dropbox.com/s/4o5b51ggziq4z ... w.dll?dl=0

If you'd like to revert the changes, rename ddraw.dll to ddraw.new and then rename ddraw.old to ddraw.dll. You can't have two ddraw DLLs on the same directory (even if they have different names). So it's important that the extension is changed from DLL to something else.

Finally, feel free to report any artifacts or bugs you may experience. Again, VR is not supported yet, but the regular version should be relatively stable.
Quick question. Will the new code for the DDraw.cfg go in as a brand new line item at the bottom of the file or is it replacing and existing line of text in the DDraw.cfg?

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

Post by blue_max » Tue Jan 25, 2022 12:05 am

BadWookiee wrote:
Mon Jan 24, 2022 11:52 pm
Quick question. Will the new code for the DDraw.cfg go in as a brand new line item at the bottom of the file or is it replacing and existing line of text in the DDraw.cfg?
You can put it at the bottom of DDraw.cfg, in a new line.

User avatar
Old_Jedi
Cadet 2nd Class
Posts: 86
Joined: Wed Apr 08, 2009 1:24 pm

Post by Old_Jedi » Tue Jan 25, 2022 5:13 pm

Thanks guys - great work as ever! No problem running this on my old Dell i5 8400 8 GB RAM with an integrated NVIDIA GTX 1050Ti. I did not notice any real difference in performance but have only played a few quick skirmishes. Really looking forward to the VR-capable version for my gaming laptop though!

OJ

User avatar
FFM-IGEL
Cadet 4th Class
Posts: 18
Joined: Fri Nov 27, 2020 6:21 pm

Post by FFM-IGEL » Tue Jan 25, 2022 5:55 pm

Hello and many, many thanks for your continuous improvement. Everything is running smoothly so far. No artifacts detected yet.
You guys are great!

ben1
Cadet 4th Class
Posts: 24
Joined: Sat Oct 17, 2020 4:35 pm

Post by ben1 » Tue Jan 25, 2022 10:40 pm

The guy who did this needs to do a serious interview explaining his genius. Fantastic work.

User avatar
Ace Antilles
Admiral (Moderator)
Posts: 6600
Joined: Sat Jan 22, 2000 12:01 am
Contact:

Post by Ace Antilles » Tue Jan 25, 2022 10:48 pm

ben1 wrote:
Tue Jan 25, 2022 10:40 pm
The guy who did this needs to do a serious interview explaining his genius. Fantastic work.
Well his XWAU genius has helped him get a serious job in the kinda "gaming" business ;)

For anyone testing and watching FPS don't forget you will still get a fair drop in FPS when you have a cockpit view enabled.
You can sometimes add around 50 fps when you turn those off by pressing ".", and also D as needed.
Still with the improvements now it's not as much a problem :)
Chief XWAU Team annoying nitpicker.
Ace Antilles - The X-Wing Outpost
Image

User avatar
haui
Cadet 2nd Class
Posts: 93
Joined: Mon Apr 15, 2019 9:29 am
Contact:

Post by haui » Wed Jan 26, 2022 7:48 am

Will test it later
It's better to burn out than to fade away .

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

Post by MechDonald » Wed Jan 26, 2022 12:24 pm

Absolutely fantastic job @blue_max

I'm very happy! The game is smooth as silk now. Great, great work! :)

lookiamcool
Recruit
Posts: 1
Joined: Wed Jan 26, 2022 1:08 pm

Post by lookiamcool » Wed Jan 26, 2022 1:29 pm

I've been a lurker for decades, but created my account just to say ---
AWESOME work! XWA feels like a brand new game on a brand new engine and this is the cherry on top.
Thanks for all the incredible work!!

Edit -- does anyone know how to enable the FPS counter in the corner? I can't seem to find the functionality in XWAhacker or any of the .cfg files.

User avatar
haui
Cadet 2nd Class
Posts: 93
Joined: Mon Apr 15, 2019 9:29 am
Contact:

Post by haui » Wed Jan 26, 2022 4:03 pm

Ok now my first test; No Problems every thing runs smooth. Thank you.
It's better to burn out than to fade away .

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

Post by marcop000 » Wed Jan 26, 2022 6:04 pm

lookiamcool wrote:
Wed Jan 26, 2022 1:29 pm
I've been a lurker for decades, but created my account just to say ---
AWESOME work! XWA feels like a brand new game on a brand new engine and this is the cherry on top.
Thanks for all the incredible work!!

Edit -- does anyone know how to enable the FPS counter in the corner? I can't seem to find the functionality in XWAhacker or any of the .cfg files.
You can download this:

https://fraps.com/download.php

klickhom
Cadet 4th Class
Posts: 19
Joined: Sun Oct 25, 2020 3:13 pm

Post by klickhom » Wed Jan 26, 2022 9:50 pm

Good job.

I've tried it. I get increase from 150fps max to 230fps max aprox.
Default effects settings at 1080p.
5600X + RX5700XT

Tried B1M1 TFTC Classic.
In one "round" I had a crash. In another full mission play I had no problem.
Max FPS were 230 and MIN were 90 more or less.
High GPU, use usually (70 to 90%)
CPU very constant use of 14%

Any "bigger battle" I could try? XWA, TFTC Classic or reimagined?
In some B7M?? or B8M?? Classic I could see that I was probably still CPU bottlenecked. FPS went "low" but GPU use was also low.

Any test you would want me to run? With video or performance statistics or whatever?

User avatar
Ace Antilles
Admiral (Moderator)
Posts: 6600
Joined: Sat Jan 22, 2000 12:01 am
Contact:

Post by Ace Antilles » Wed Jan 26, 2022 10:38 pm

klickhom wrote:
Wed Jan 26, 2022 9:50 pm
Any test you would want me to run? With video or performance statistics or whatever?
Good tests are large battles such as the Battle of Endor missions.
Also the final missions with the many waves of TIE Experimentals might be interesting.

We're also hearing of little issues with different hangars (in TFTFC), and maybe the Tech Globe.
So checking if everything shows in the Tech Globe could be good too. Thanks :)
Chief XWAU Team annoying nitpicker.
Ace Antilles - The X-Wing Outpost
Image

Post Reply