zbysiek Posted September 2, 2024 Posted September 2, 2024 (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 October 9, 2024 by zbysiek Fixed formatting 6 8
Zyll Posted September 3, 2024 Posted September 3, 2024 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.
MadKreator Posted September 4, 2024 Posted September 4, 2024 (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 September 4, 2024 by MadKreator 3 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
Zyll Posted September 4, 2024 Posted September 4, 2024 (edited) I'm seeing the odd glass issue that was reported for the Apache I believe Patched files Unmodified files 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 September 4, 2024 by Zyll 2
zbysiek Posted September 4, 2024 Author Posted September 4, 2024 16 hours ago, Zyll said: I'm seeing the odd glass issue that was reported for the Apache I believe Patched files Unmodified files 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. 2
zbysiek Posted September 4, 2024 Author Posted September 4, 2024 (edited) 16 hours ago, Zyll said: I'm seeing the odd glass issue that was reported for the Apache I believe Patched files Unmodified files 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 September 4, 2024 by zbysiek 3
Zyll Posted September 4, 2024 Posted September 4, 2024 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
zbysiek Posted September 4, 2024 Author Posted September 4, 2024 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? 1
Zyll Posted September 4, 2024 Posted September 4, 2024 (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 September 4, 2024 by Zyll 1
zbysiek Posted September 4, 2024 Author Posted September 4, 2024 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. 1
Zyll Posted September 4, 2024 Posted September 4, 2024 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? 1
zbysiek Posted September 4, 2024 Author Posted September 4, 2024 (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 September 4, 2024 by zbysiek 1
zbysiek Posted September 5, 2024 Author Posted September 5, 2024 (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 Unmodified files 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 September 5, 2024 by zbysiek 1
zildac Posted September 5, 2024 Posted September 5, 2024 (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 September 5, 2024 by zildac 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
Bounti30 Posted September 5, 2024 Posted September 5, 2024 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
zildac Posted September 5, 2024 Posted September 5, 2024 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: Posted Monday at 08:41 PM (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. 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 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
zbysiek Posted September 5, 2024 Author Posted September 5, 2024 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?
zbysiek Posted September 5, 2024 Author Posted September 5, 2024 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!) 3
zbysiek Posted September 5, 2024 Author Posted September 5, 2024 (edited) Also added all apache reflection files and the A-10C HMCS to the blacklist. Edited September 6, 2024 by zbysiek 1
zbysiek Posted September 5, 2024 Author Posted September 5, 2024 Fixed the script creating empty folders. 1
diego999 Posted September 6, 2024 Posted September 6, 2024 (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 September 6, 2024 by diego999 typo 1
Bounti30 Posted September 6, 2024 Posted September 6, 2024 (edited) 15 hours ago, zbysiek said: What steps are you having issues with? where should we put texconv.exe Thanks Edited September 6, 2024 by Bounti30 I9 9900k, RTX3090, 32Go, Nvme SDD, X56, pro rudder pedals, Quest2
zildac Posted September 6, 2024 Posted September 6, 2024 1 hour ago, Bounti30 said: where should we put texconv.exe Thanks In the same directory from where you run the PS script. 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
Bounti30 Posted September 6, 2024 Posted September 6, 2024 THANKS I'll try 1 I9 9900k, RTX3090, 32Go, Nvme SDD, X56, pro rudder pedals, Quest2
Recommended Posts