Tips to Increase the Performance of the New Shaders

Here you can find help for how to best run and setup your XWA VR experience.

Tips to Increase the Performance of the New Shaders

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

Post by blue_max » Sat Apr 11, 2020 11:59 pm

I've received several questions of this sort in the past few days, so I'm making a new thread to keep track of all the things you can do to improve performance when using the new shaders from VR mod 1.1.2

Please, remember that this is a 20-year-old engine. It still does all the 3D processing in the CPU using a single core, and it mostly ignores the power of the GPU in your video card.

Bear in mind that if you have lots of geometry on the screen, that will slow down the game. This is a limitation of XWA's engine and will happen even if you disable all the effects. Some of the newer XWAU models have a higher polygon count and will have a larger performance impact too.

Having said that, there's a few things you can do to improve the performance of the new shaders:

1. Remember to set "IsHookD3DEnabled = 0" in hooks.ini.

2. Lower your resolution. You may want to play at 4K; but your machine may not be able to cope.

3. Use the hook_time.dll to remove the FPS limitation of XWA. I can achieve ~90fps at 1920x1080 with this hook (unless the screen is super busy with geometry).

4. Disable MSAA or lower the MSAA count. If you enabled MSAA, the default behavior is to use the maximum number of samples available. I have added a new setting in DDraw.cfg, called "MSAACount" to use a different number of samples. Try "MSAACount = 4", for instance, or 2. If the setting does not exist in your DDraw.cfg, just add it.

5. Use FXAA instead of MSAA. FXAA is an alternative to reduce jaggies and it's much faster than MSAA (but it has disadvantages too). Add the line "EnableFXAA = 1" in DDraw.cfg to enable it. You can also try combining FXAA with a low-sample count MSAA. For instance, try the following:

EnableMultisamplingAntialiasing = 1
MSAACount = 2
EnableFXAA = 1

(If the settings don't exist in your DDraw.cfg, just add them)

6. Select a different shader with the installer. The fastest shader is the Deferred shader, next comes SSAO and finally, SSDO. The slower the shader, the higher the quality. You can also disable all the shaders with the installer and use XWA's original shading system; but you'll have to open SSAO.cfg and set "disable_xwa_diffuse = 0" too.

7. The performance of SSAO and SSDO can be improved by lowering the quality of the occlusion/shadow buffer. Open SSAO.cfg and set "ssao_buffer_scale_divisor = 2.0".

8. Select a lower bloom setting using the installer. You can also disable the new shaders using the installer; but still keep the bloom effect.

EDIT (Aug 28, 2020): Some people have reported that setting "ProcessAffinityCore = 0" in DDraw.cfg also helps improve performance (the default is 2). So this is something you may also want to try. However, make sure you have the music_freeze hook or you may experience problems with the music playback.

EDIT (Dec 2020). These tips come from JoeTheAnorak's post on page 3 in this thread:

Oculus Tray Tool – Make a profile which sets CPU Priority to High - saves you doing this before every launch. ASW remains auto.
Alternative: Run XWA, then open the Task Manager. Right click on X-Wing Alliance --> Go to Details. Then Right click on xwingalliance.exe --> Set Priority --> High.

nVidia Settings – Set up a profile for XWA specifically where:

Threaded optimisation = off
VR pre-rendered frames = 4
low latency mode = on
V-Sync = off
Last edited by blue_max on Thu Mar 09, 2023 5:13 pm, edited 5 times in total.

Batou
Cadet 4th Class
Posts: 12
Joined: Sun Feb 17, 2019 5:18 pm

Post by Batou » Sun Apr 12, 2020 8:08 am

3. Use the hook_time.dll to remove the FPS limitation of XWA. I can achieve ~90fps at 1920x1080 with this hook (unless the screen is super busy with geometry).
This hook is actived automatically or i need to do a action ?

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

Post by Vince T » Sun Apr 12, 2020 8:27 am

Great thread blue_max. That really helps sort out where I can tweak things.
Thank you!
Your ship, Captain. I need a drink. - Vince Trageton
Vince T's X-Wing HQ - where the bad guys get their gear

User avatar
Trevor
Lieutenant JG
Posts: 541
Joined: Thu Dec 04, 2014 7:11 pm

Post by Trevor » Sun Apr 12, 2020 6:38 pm

haha, when NOT in VR I use 256 samples at 1920x1080 :P

Runs fine :)

Trev

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

Post by keiranhalcyon7 » Sun Apr 12, 2020 6:59 pm

Looks good, blue_max. Could you comment on which items impact CPU load vs. GPU load?

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

Post by Vince T » Sun Apr 12, 2020 7:37 pm

You haven't played a 75k vertices Victory Star Destroyer yet XD
Your ship, Captain. I need a drink. - Vince Trageton
Vince T's X-Wing HQ - where the bad guys get their gear

User avatar
BenKenobi
Cadet 2nd Class
Posts: 94
Joined: Wed Mar 18, 2020 12:30 pm

Post by BenKenobi » Sun Apr 12, 2020 7:37 pm

Thank you for this information!
blue_max wrote:
Sat Apr 11, 2020 11:59 pm
...
It still does all the 3D processing in the CPU using a single core
...
So, when I want to take X-Wing's performance into account when selecting a CPU for a new PC I should pay attention to the Single Thread Performance as compared here: https://www.cpubenchmark.net/singleThread.html ?

Any advise on what to look for in a new Video Card?

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

Post by Ace Antilles » Sun Apr 12, 2020 7:54 pm

Will have to check some of these. What about the opposite if anyone wanted to try?
Are there any tips to increase the graphics look even more or does the XWAUCP basically max it out now?

Nvidia allow tweaks in their control panel for example will any of those likely work?
Chief XWAU Team annoying nitpicker.
Ace Antilles - The X-Wing Outpost
Image

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

Post by blue_max » Mon Apr 13, 2020 5:08 pm

@Batou: Just make sure that a file called hook_time.dll is present in your XWA directory. If you don't have this hook, you can always download the latest hooks by Jeremy.

@BenKenobi: Yes, single-threaded performance is a good indicator of how much XWA will improve. As for a good GPU, I guess anything that came out in the last 2 years should be good enough? You need DirectX 11 and shader model 5; but support for that is widely spread. Obviously, the fastest/most expensive, the better. I can run this game comfortably with my nVidia 1060, for instance. Maybe others can chime in with some other sample specs.

@Ace Antilles: The installer does not max out settings at the moment; but it's close. You can enable indirect illumination at one bounce in SSDO. Open SSAO.cfg and set "enable_indirect_ssdo = 1". I also need to go back to SSDO and finish a high-quality implementation (at this moment, I'm only using SSDO to compute contact shadows; but it can be used to integrate lighting coming from all directions). I've never seen much difference when tweaking the settings in the nVidia control panel; but let me know if you find anything interesting.

@keiranhalcyon7: Currently, the game sends 2D vertices + depth + color + uv coordinates to ddraw. This means that all 3D transformations (object -> world -> view), culling (removing objects that are not in front of the camera), projection (3D -> 2D) and clipping (cutting all polygons so that they form a square viewport for display on a monitor) is done in the CPU, on a single thread (plus the game logic, sound processing, device input, etc). Rasterization and texture mapping is done in the GPU. I think that's pretty much what the original game uses the GPU for: rendering textured 2D triangles with depth. In a modern game, the 3D transformations, projection and clipping would also be done in the GPU, in parallel.

So, I guess, to answer your question: screen resolution and texture size impacts the GPU. If you have high-res textures, you'll consume more GPU RAM. Higher resolutions will also put more load on your GPU; but the impact on the CPU will be negligible. Polygon count/Scene complexity will impact both the CPU and GPU; and the rest (like audio) will impact the CPU and other devices.

User avatar
XDragon
Cadet 1st Class
Posts: 119
Joined: Tue Jan 29, 2008 12:01 am
Contact:

Post by XDragon » Thu Apr 16, 2020 11:33 pm

So i followed everything and am running on the lowest settings the new effects/dynamic cockpit will go and i still have jerky laggy movements of the crafts. I even took off the inertia to see if that helps. I love the effects, but i can't seem to get it to run smoothly with them active.

Is there anything else i can do to try and improve this? Or should i just throw in the towel and save for a slightly better graphics card?
Founder of Z3R0 (Zero Command)
https://xdragon2688.wixsite.com/z3ro/

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

Post by blue_max » Fri Apr 17, 2020 6:21 pm

What video card/processor are you using, XDragon? What resolution are you trying to run? How does the game behave when you use Jeremy's 1.3.9 ddraw?

Batou
Cadet 4th Class
Posts: 12
Joined: Sun Feb 17, 2019 5:18 pm

Post by Batou » Sat Apr 18, 2020 1:06 pm

i thinks there is a problem with the ddrw or the dinput.

withe xwa craft i have about 50fps in 1080, when i installed the bluemax effect its fall about 7 fps.
There is no modification with another resolution or MSSA off, FXAA off or SSAO.

When i desinstall the bluemax effect i stay with the 7 fps.
I must reinstall xwa and the xwa craft to solve this.

User avatar
JeremyaFr
XWAU Member
Posts: 3921
Joined: Mon Jan 18, 2010 5:52 pm
Contact:

Post by JeremyaFr » Sat Apr 18, 2020 1:50 pm

Hello,
Can you try with previous versions od DDraw dll?
https://github.com/JeremyAnsel/xwa_ddraw_d3d11/releases

User avatar
XDragon
Cadet 1st Class
Posts: 119
Joined: Tue Jan 29, 2008 12:01 am
Contact:

Post by XDragon » Sat Apr 18, 2020 4:59 pm

blue_max wrote:
Fri Apr 17, 2020 6:21 pm
What video card/processor are you using, XDragon? What resolution are you trying to run? How does the game behave when you use Jeremy's 1.3.9 ddraw?
Radeon HD 3600 Series so I'm using the new DDraw you made for shaders less than 5.0

processor is: Pentium Duel Core E5300@ 2.60 GHZ2.62 GHZ

8 gb ram

Windows 10 64 bit
Founder of Z3R0 (Zero Command)
https://xdragon2688.wixsite.com/z3ro/

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

Post by Ace Antilles » Mon Apr 20, 2020 5:29 pm

Now I've got things working ok I can see what I can alter to try and up FPS a little.
It's a combination of several things that seem to affect the frames.
Effects, Super Backdrops and the Cockpits. For example if you turn off the cockpit and fly then the FPS is a little better.

How exactly do you edit hook_time.dll? Or change the FPS.
That's thing I'm still a little sketchy on how you alter the DLL and which program. Thanks
Chief XWAU Team annoying nitpicker.
Ace Antilles - The X-Wing Outpost
Image

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

Post by blue_max » Mon Apr 20, 2020 6:26 pm

Ace Antilles wrote:
Mon Apr 20, 2020 5:29 pm
How exactly do you edit hook_time.dll? Or change the FPS.
Nothing to do there, just make sure that hook_time.dll is in your XWA directory.

User avatar
XDragon
Cadet 1st Class
Posts: 119
Joined: Tue Jan 29, 2008 12:01 am
Contact:

Post by XDragon » Tue Apr 21, 2020 3:22 am

Blue, any additional things I can try? As for resolution I went to the lowest. I don't know if it's just because the system can't handle 5.0 for nthe shaders
Founder of Z3R0 (Zero Command)
https://xdragon2688.wixsite.com/z3ro/

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

Post by blue_max » Tue Apr 21, 2020 3:39 am

XDragon wrote:
Tue Apr 21, 2020 3:22 am
Blue, any additional things I can try? As for resolution I went to the lowest. I don't know if it's just because the system can't handle 5.0 for nthe shaders
I suspect some machines may have lower performance with SM4 shaders. However, I tested this on my 5-year-old-desktop; but I didn't notice any difference, so I'm not sure. I think I have to go back to the code and start optimizing things; but that's going to take a while.

Just to be sure, when you say you went to the lowest resolution: you changed your *desktop's* resolution, right? Changing the in-game resolution doesn't really have any effect.

Batou
Cadet 4th Class
Posts: 12
Joined: Sun Feb 17, 2019 5:18 pm

Post by Batou » Tue Apr 21, 2020 9:24 am

I have good fps on ddraw 1.3.6, when i passed to 1.3.7 or superior i have 7 fps.
The D3D hook is actived.
How i can be sure that the GPU used is my Nvidia and not the shipset of the motherboard ?

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

Post by blue_max » Tue Apr 21, 2020 4:54 pm

Batou wrote:
Tue Apr 21, 2020 9:24 am
How i can be sure that the GPU used is my Nvidia and not the shipset of the motherboard ?
In the Concourse, press Esc to go to the menu. Video Options --> Single Player Options --> Video Display Driver. Make sure it says "nVidia" in there.

If your card doesn't appear there, then open the nVidia control panel (right click on the desktop, select it from the pop-up menu). Go to Manage 3D Settings on the left pane --> Program Settings tab, in "Select Program to Customize" click on 'Add" and browse to the path where your xwingalliance.exe lives. In "Select the preferred graphics processor" select your nVidia processor. Click on "Apply". You can further customize some settings if you want too; but that should force the game to use your nVidia card.

User avatar
XDragon
Cadet 1st Class
Posts: 119
Joined: Tue Jan 29, 2008 12:01 am
Contact:

Post by XDragon » Tue May 05, 2020 5:33 pm

Is there a way to set the game display independent of the computer? I got the effects finally running fairly smooth (having issues making small adjustments but i blame the inertia)

I just hate my desktop looking so jumbo
Founder of Z3R0 (Zero Command)
https://xdragon2688.wixsite.com/z3ro/

User avatar
Trevor
Lieutenant JG
Posts: 541
Joined: Thu Dec 04, 2014 7:11 pm

Post by Trevor » Tue May 05, 2020 6:08 pm

You can play in a window, but I guess you would want a scale/fill too.

Trev

User avatar
XDragon
Cadet 1st Class
Posts: 119
Joined: Tue Jan 29, 2008 12:01 am
Contact:

Post by XDragon » Tue May 05, 2020 6:44 pm

I was kinda thining the resolution hooks would do what i'm trying to do but they don't seem to. I guess I just have to switch to low resolution before launching the game
Founder of Z3R0 (Zero Command)
https://xdragon2688.wixsite.com/z3ro/

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

Post by blue_max » Wed May 06, 2020 2:46 am

I've published a micro-update for 1.1.3 that might help improve performance by selectively disabling the text and radar renderers here:

https://xwaupgrade.com/phpBB3/viewtopic.php?f=9&t=12455

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

Post by keiranhalcyon7 » Wed May 06, 2020 7:55 am

Oh I get it... in XDragon's case, a setting to have the game do the "old school" thing and directly control the screen resolution would be helpful. It's become kind of an unusual use case, but maybe not an unreasonable request?

XDragon, out of curiosity, are you still using a CRT monitor?

Post Reply