Jump to content

Recommended Posts

Posted (edited)

I've made a simple powershell script to automate the process of making a "Optimized Textures" mod like you can see in this topic:


Requirements:
Script: https://gist.github.com/zbysiek/8df79276f659674b3926a0a757050f2f
TexConv:
https://github.com/microsoft/DirectXTex/releases
Powershell 7.4:
https://learn.microsoft.com/powershell/scripting/install/installing-powershell-on-windows?view=powershell-7.4#installing-the-msi-package

Usage instructions:
0. Delete _backup and _downloads folder in your main DCS Install to avoid compressing unnecessary files
1. Create a folder on your desktop, place the script and texconv.exe there
2. Open powershell as admin, type Set-ExecutionPolicy Unrestricted
3. Close the powershell window (we don't want to execute the script as admin, just in case, DO NOT EXECUTE THE SCRIPT AS ADMIN)
4. Open Powershell 7 in the same folder by right clicking > Powershell 7 > Open Here (DO NOT OPEN AS ADMIN)
5. Make sure the path in the console is pointing to the correct folder, if not type: cd "full-path-to-folder"
5. Execute the script by typing in .\dcs-texture-optimizer.ps1
5. Select your main DCS folder in the pop up window
6. Wait for it to finish
(Optional, but recommended):
7. Open powershell as admin, type Set-ExecutionPolicy Restricted


After it's done the files are gonna be ready in a OvGME ready format under ./Mod

I highly recommend using a mod manager that works via SymLinks, like this one: https://www.digitalcombatsimulator.com/en/files/3339453/
 

Original comment: https://forum.dcs.world/topic/323252-dcs-optimized-textures/page/10/#comment-5512828

The script is primarily designed to be pointed into the main game, but you can also point it to a specific folder. Just make sure there's a directory or a zip with the filters in the whitelist.

If you want it to work on every texture instead, replace the # --------------- CUSTOMIZE HERE --------------- lines with this: 
For example if you want to lower your terrain textures just a little bit instead of having to go low, just make sure to not point it to the root directory or you might have to wait a light year or two.

 

Edited by zbysiek
Fixed formatting
  • Like 6
  • Thanks 8
Posted

Ran it today and after it finished, it left a tacan.zip folder containing two bmp files in temp. Not a big deal, but wondering if its terminating oddly.

Posted (edited)

Ran this last night, worked good. ( I had an issue with ovgme install, but it was my fault. I forgot I had model viewer open and minimized 🤦‍♂️) It reduced the texture files from around 140 gigs down to 61 gigs. However performance-wise I didn’t notice any difference. I’m sure that’s very system dependent.  Visual quality-wise I also noticed no difference ( which is good). So I will 100% jump on the train. Even if it’s just for space saving I do believe that ED could reduce the texture size with no ill effects. I run a 48” 4K oled screen, msaa x4 and graphical fidelity looked identical to me 😁
- took about 20-30 minutes to run/convert 4000 files.. not including downloaded liveries 😂
-Great job on the script @zbysiek

Edited by MadKreator
  • Like 3
  • Thanks 1

Intel i7 13700k, ASUS  rog strix z790A, 64gigs G.Skill Trident DDR5 @6400Mhz, Nvidia  RTX 4080FE, 4TB,  2x 2TB,  1TB Samsung NVME, 1TB Samsung SSD,   Corsair RM1000x, Corsair Titan 360 X AIO cooler, Lian Li LanCool 2, VKB Gunfighter Ultimate, VKB Custom STECS , MFG Crosswinds, Moza FFB,  Virpil Collective, Track IR5, 48” LG UltraGear OLED & HP 24” touchscreen for Helios,49” Samsung Ultrawide,  Streamdeck XL, Corsair Virtuoso RGB Headphones

Posted (edited)

I'm seeing the odd glass issue that was reported for the Apache I believe

 

Patched files

DCS_2024.09.03-20.11.png

 

Unmodified files

DCS_2024.09.03-20.26.png

maybe specifically for these kind of scenarios, we need a blacklist as well so we can instruct the script to ignore very specific files

Edited by Zyll
  • Like 2
Posted
16 hours ago, Zyll said:

I'm seeing the odd glass issue that was reported for the Apache I believe

 

Patched files

DCS_2024.09.03-20.11.png

 

Unmodified files

DCS_2024.09.03-20.26.png

maybe specifically for these kind of scenarios, we need a blacklist as well so we can instruct the script to ignore very specific files

 

For now just manually replace these files with the originals, I'll add a blacklist later.

  • Like 2
Posted (edited)
16 hours ago, Zyll said:

I'm seeing the odd glass issue that was reported for the Apache I believe

 

Patched files

DCS_2024.09.03-20.11.png

 

Unmodified files

DCS_2024.09.03-20.26.png

maybe specifically for these kind of scenarios, we need a blacklist as well so we can instruct the script to ignore very specific files

 

If you can provide me with the file names for that glass, i'll add it to the script by default.

UPDATE 04.09.2024 (V0.2.2?)
1. Added blacklists, configurable within the "# --------------- CUSTOMIZE HERE ---------------" lines (adds a lot of processing time, but just at the start of the script)

Edited by zbysiek
  • Like 3
Posted
10 minutes ago, zbysiek said:

If you can provide me with the file names for that glass, i'll add it to the script by default.

UPDATE 04.09.2024 (V0.2.2?)
1. Added blacklists, configurable within the "# --------------- CUSTOMIZE HERE ---------------" lines (adds a lot of processing time, but just at the start of the script)

 

I believe its this: ah-64d_cpt_glass_refl_RoughMet

Posted
2 minutes ago, Zyll said:

I believe its this: ah-64d_cpt_glass_refl_RoughMet

Added ah-64d_cpt_glass_refl* as default, should cover all the glass reflection files in the Apache. If more problems like that pop up I'll just change it to *glass_refl*.

Btw, is the A-10C II HMCS supposed to have a slightly tinted box?

  • Like 1
Posted (edited)

Here's a full list of the Apache files with "refl" in the filename. If you want I can DM them to you to analyze individually.

ah-64d_cpt_glass_refl.dds
ah-64d_cpt_glass_refl_RoughMet.dds
ah-64d_glass_mfd_refl.dds
ah-64d_glass_mfd_refl_RoughMet.dds
ah-64d_ihadss_glass_refl.dds
ah-64d_ihadss_glass_refl_RoughMet.dds
ah-64d_ihadss_glass_sprt_refl.dds
ah-64d_ihadss_glass_sprt_refl_RoughMet.dds

EDIT: can we create a filename mask like this? 
ah-64d*refl*.dds
it works in Windows cmd, not sure if PowerShell works similarly

Edited by Zyll
  • Like 1
Posted
5 minutes ago, Zyll said:

Here's a full list of the Apache files with "refl" in the filename. If you want I can DM them to you to analyze individually.

ah-64d_cpt_glass_refl.dds
ah-64d_glass_mfd_refl.dds
ah-64d_glass_mfd_refl_RoughMet.dds
ah-64d_ihadss_glass_refl.dds
ah-64d_ihadss_glass_refl_RoughMet.dds
ah-64d_ihadss_glass_sprt_refl_RoughMet.dds

 

Just replace it for "*_refl*" if you run into any issues, I don't think any other modules have this issue currently. Like I said the A-10C HMCS glass is very slightly tinted but whatever.

  • Like 1
Posted

oh and does blacklist or whitelist take priority? Like in the event of creating a *_refl* filename mask, if that includes RoughMet in the name, will it be processed or ignored?

  • Like 1
Posted (edited)
10 minutes ago, Zyll said:

oh and does blacklist or whitelist take priority? Like in the event of creating a *_refl* filename mask, if that includes RoughMet in the name, will it be processed or ignored?

blacklist

24 minutes ago, Zyll said:

Here's a full list of the Apache files with "refl" in the filename. If you want I can DM them to you to analyze individually.

ah-64d_cpt_glass_refl.dds
ah-64d_glass_mfd_refl.dds
ah-64d_glass_mfd_refl_RoughMet.dds
ah-64d_ihadss_glass_refl.dds
ah-64d_ihadss_glass_refl_RoughMet.dds
ah-64d_ihadss_glass_sprt_refl_RoughMet.dds

EDIT: can we create a filename mask like this? 
ah-64d*refl*.dds
it works in Windows cmd, not sure if PowerShell works similarly

 

best way to test is belive it or not, windows explorer, it's the same syntax
just make sure to put the text inside "" and separate multiple entried with a ,

Edited by zbysiek
  • Like 1
Posted (edited)
On 9/4/2024 at 2:24 AM, Zyll said:

I'm seeing the odd glass issue that was reported for the Apache I believe

 

Patched files

DCS_2024.09.03-20.11.png

 

Unmodified files

DCS_2024.09.03-20.26.png

maybe specifically for these kind of scenarios, we need a blacklist as well so we can instruct the script to ignore very specific files

 

Btw also setting the new "glass reflection" graphics option should get rid of the problem, nobody needs them anyways.

On 9/4/2024 at 1:16 AM, Zyll said:

Ran it today and after it finished, it left a tacan.zip folder containing two bmp files in temp. Not a big deal, but wondering if its terminating oddly.

Most likely it errored out due to windows defender or an edge case, I've had similar problems with _backup and trackir.zip. You can safely ignore it.

Edited by zbysiek
  • Like 1
Posted (edited)

New version of the script appears to bomb out and only creates a MOD folder with around 18GB of content. Most odd, also only takes about 10 minutes to run where previously was around 45 minutes and around 56GB. Is there anyway of enabling some kind of debug log?

Scratch that, looks to be a disk space issue.

Edited by zildac
  • Like 1

14900KS | Maximus Hero Z690 | ASUS 4090 TUF OC | 64GB DDR5 6600 | DCS on 2TB NVMe | WarBRD+Warthog Stick | CM3 | TM TPR's | Varjo Aero

Posted
On 9/2/2024 at 9:41 PM, zbysiek said:

I've made a simple powershell script to automate the process of making a "Optimized Textures" mod like you can see in this topic:


Requirements:
Script: https://gist.github.com/zbysiek/8df79276f659674b3926a0a757050f2f
TexConv:
https://github.com/microsoft/DirectXTex/releases
Powershell 7.4:
https://learn.microsoft.com/powershell/scripting/install/installing-powershell-on-windows?view=powershell-7.4#installing-the-msi-package

Usage instructions:
0. Delete _backup and _downloads folder in your main DCS Install to avoid compressing unnecessary files
1. Open powershell as admin, type Set-ExecutionPolicy Unrestricted
2. Close the powershell window (we don't want to execute the script as admin, just in case, DO NOT EXECUTE THE SCRIPT AS ADMIN)
3. Open Powershell 7 in the same folder by right clicking > Powershell 7 > Open Here (DO NOT OPEN AS ADMIN)
4. Select your main DCS folder
5. Wait for it to finish
6. Open powershell as admin, type Set-ExecutionPolicy Restricted


After it's done the files are gonna be ready in a OvGME ready format under ./Mod

 

Original comment: https://forum.dcs.world/topic/323252-dcs-optimized-textures/page/10/#comment-5512828

The script is primarily designed to be pointed into the main game, but you can also point it to a specific folder. Just make sure there's a directory or a zip with the filters in the whitelist.

 

Thank you for this work
But can you detail the procedure I am not experienced in the use of scripts and powersheel

I9 9900k, RTX3090, 32Go, Nvme SDD, X56, pro rudder pedals, Quest2

Posted
45 minutes ago, Bounti30 said:
Thank you for this work
But can you detail the procedure I am not experienced in the use of scripts and powersheel

In this first post:

    •  

I've made a simple powershell script to automate the process of making a "Optimized Textures" mod like you can see in this topic:


Requirements:
Script: https://gist.github.com/zbysiek/8df79276f659674b3926a0a757050f2f
TexConv:
https://github.com/microsoft/DirectXTex/releases
Powershell 7.4:
https://learn.microsoft.com/powershell/scripting/install/installing-powershell-on-windows?view=powershell-7.4#installing-the-msi-package

Usage instructions:
0. Delete _backup and _downloads folder in your main DCS Install to avoid compressing unnecessary files
1. Open powershell as admin, type Set-ExecutionPolicy Unrestricted
2. Close the powershell window (we don't want to execute the script as admin, just in case, DO NOT EXECUTE THE SCRIPT AS ADMIN)
3. Open Powershell 7 in the same folder by right clicking > Powershell 7 > Open Here (DO NOT OPEN AS ADMIN)
4. Select your main DCS folder
5. Wait for it to finish
6. Open powershell as admin, type Set-ExecutionPolicy Restricted

  • Like 1

14900KS | Maximus Hero Z690 | ASUS 4090 TUF OC | 64GB DDR5 6600 | DCS on 2TB NVMe | WarBRD+Warthog Stick | CM3 | TM TPR's | Varjo Aero

Posted
1 hour ago, Bounti30 said:
Thank you for this work
But can you detail the procedure I am not experienced in the use of scripts and powersheel

What steps are you having issues with?

Posted
On 9/4/2024 at 7:11 PM, zbysiek said:

If you can provide me with the file names for that glass, i'll add it to the script by default.

UPDATE 04.09.2024 (V0.2.2?)
1. Added blacklists, configurable within the "# --------------- CUSTOMIZE HERE ---------------" lines (adds a lot of processing time, but just at the start of the script)

 

UPDATE 05.09.2024 (V0.2.3)
1. Fixed filed inside zips not respecting the blacklist (Thanks Zyll!)

  • Like 3
Posted (edited)

Before the script: 351GB DCS folder.

After the script: 314GB DCS folder.

And I don't even own some of the heaviest modules like the Apache, or have the newest ones like the Phantom or the CH-47 (I'm running version 2.9.2).

Amazing.

Edited by diego999
typo
  • Like 1
Posted (edited)
15 hours ago, zbysiek said:

What steps are you having issues with?

where should we put texconv.exe

Thanks

Edited by Bounti30

I9 9900k, RTX3090, 32Go, Nvme SDD, X56, pro rudder pedals, Quest2

Posted
1 hour ago, Bounti30 said:

where should we put texconv.exe

Thanks

 

In the same directory from where you run the PS script.

  • Like 1

14900KS | Maximus Hero Z690 | ASUS 4090 TUF OC | 64GB DDR5 6600 | DCS on 2TB NVMe | WarBRD+Warthog Stick | CM3 | TM TPR's | Varjo Aero

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...