It brutally appeared to me that DDS textures generation for MSFS are quite painful.
If you're working on a complete asset that you're going to build with the SDK anyway, it's not a problem. But if you're simply working on a livery, maybe you don't want to create a whole package and build it all the time.
This toolbox uses "Compressonator CLI" (freeware available here https://github.com/GPUOpen-Tools/compressonator/releases) to handle PNG <> DDS conversions.
And "imagemagick" (freeware available here https://imagemagick.org/script/download.php#windows) to detect PNG channels depth (8-bit or 16-bit) and handle the Composite "Join" and "Split" operations. Go for this version : ImageMagick-7.1.0-portable-Q16-x64.zip which contains all the required executables.
PNG2DDS.ps1
You can convert a single PNG file or all the PNG files of a folder to apporopriate DDS textures + JSON descriptors:
- It auto-detects if the PNG source has an alpha layer and depending on the type of texture (Albedo, Composite, Normals), it selects the appropriate DDS compression (BC1, BC3, BC7, BC5_S) and writes the correct JSON tags.
- For now, 16-bits textures are ignored.
DDS2PNG.ps1
Exactly the opposite. Converts DDS files (a complete folder or a single file) to PNG.
DDS-JSON-Generator.ps1
You can generate a correct DDS.json file for a given DDS file or all the DDS files of a folder.
Join-COMP.ps1
Generates a Composite RGB file with Ambient Occlusion/Roughness/Metallic channels from any PNG given as input or any suitable files in a given folder.
- You can specify any of the 3 channels as the argument. The script will find the others if your files are named as expected and located within the same folder. (xxx_AO.PNG, xxx_ROUGH.PNG, xxx_METAL.PNG).
Split-COMP.ps1
Separates the RGB channels of a composite PNG file to 3 standalones PNGs. Or does the same for all COMP files within a given folder.
- These files will be suffixed with _AO.PNG, _ROUGH.PNG and _METAL.PNG
- The script checks first if these files don't already exist and will throw an error if any of them is present.
Requirements:
- it works on Windows 10/11
- You need to be able to run unsigned PowerShell scripts
- You will need to have Compressonator CLI (freeware) and set the path to "compressonatorcli.exe" in the $compressonatorPath variable of PNG2DDS.ps1 and DDS2PNG.ps1.
- And finally, you need to have ImageMagick (freeware) and set the path to the folder containting all executables in the $magickPath variable of PNG2DDS.ps1, DDS2PNG.ps1, Join-COMP.ps1 and Split-COMP.ps1.
14 hours ago
lolafacerola
2 days ago
lolafacerola
Hi. I used these tools to compile PNG to DDS for a C208 livery as it was freezing the sim. I thought I got the solutions for my issue, but it does not work. The new DDS are still freezing the MSFS in the hangar. What am I missing?
12 months ago
Hi, are you sure this freeze is due to a texture?
Regarding your textures dimension, their height and width (in pixels) are multiples of 8? (I'm not even sure you could make a DDS if not, but maybe it's worth checking).
12 months ago
LordFrites
Viktoren69
Hi Lord,
Is it possible to specify a specific input-folder in the DDS2PNG.ps1 file ?
Background:
If i convert textures, i copy them always in e.g. C:\MSFSTEXTEMP, than fire up the DDS2PNG.ps1 with powershell, paste the directory and hit enter.
Would be great if i could modify the .ps1 in a way, i only would have to run it and it automatic uses the folder i specified.
BR Five-Birds
1 years ago
Oh, yes, good idea. Plus I'm actually doing this more and more often :) I'll publish an update really soon! (probably today. Let's go!) :)
1 years ago
LordFrites
FiveBirds
after today's windows 11 update the DDS-JSON-Generator script no longer works in PowerShell, the window closes immediately after opening.
Some suggestions?
1 years ago
Damn it...
I'm still on Windows 10 :)
I'm guessing that without a clue, but is it possible that your Windows update reinitialized the "execution policy" of your computer?
try the PowerShell cmdlet: "Get-ExecutionPolicy" and if it says anything too restrictive, change it to something more "convenient" to you.
But probably it's not that and... well... I'll have to update to Windows 11 too one day :D
1 years ago
LordFrites
flavio1
Just found this tool now and it's super handy. No more need for opening each png in PS and then exporting to dds. Now, I did run into an issue: in my install folder of ImageMagick there's no identify.exe, thus throwing an error while running the script (it does export fine). I just downloaded the most recent .exe from the website. Is there another version I need?
2 years ago
Thanks for your comment!
And you're right, I should have been more precise. I'll update the description right now. The version you need is "ImageMagick-7.1.0-portable-Q16-x64.zip". This one contains the "identify.exe" (and many other stuff we don't use [yet])
2 years ago
LordFrites
simtom
Very, very useful tools here. Have you guys found a way to save/convert those "NORM" textures? They are driving me crazy, no matter what I try, textures will always have a weird look!
2 years ago
From PNG to DDS, without the fspackager thing, yes. It works well.
But from DDS, to get back to PNG... There are still issues. I've tried various encodings proposed by the tools my scripts are based onto.
But it's on my todo list for this toolbox. So, one day... we'll make it work!
2 years ago
LordFrites
GloRupt
Love these scripts, streamlines the process quite a bit.
I did fine one bug that is a little annoying, the PNG files are sometimes locked after running the script, this is caused by the alpha detection, it can be resolved by closing the file once done with it, just add $png.Dispose() on line 105 of PNG2DDS.
I'd also replace the read-host with a proper parameter, saves a couple of lines and having to evaluate something. Just remove the if/else on line 19/20 and add the below to the top of the script, has all the same functionality.
[CmdletBinding()]
param (
[Parameter()][string]$Path = (Read-Host 'PNG File path/Folder path')
)
2 years ago
Thanks, I'll take a look at this today or tomorrow and try to improve the scripts a little bit (I didn't touch them for quite some time now!)
2 years ago
LordFrites
JeffHiggins
This would have saved me 2 days of Googling for answers why my custom normal map totally ruined the looks of the heli but now I keep this in a save place 😊 Still a mystery for me what it does to a normal map while packaging it. Tried it as well with the SDK but got other weird errors while this does a perfect job! Thanks!
2 years ago
if you find the answer to Asobo's "Normal Map Black Magic", I'm still interested ;)
2 years ago
LordFrites
ozboz
Meanwhile got it to work. Perfect tool! 5-Star+ worth
Thanks
FVBRDS
2 years ago
Thanks :) Yeah, I'd like to find/make more tools like this modest collection of scripts. Because working with the SDK and doing even simple tasks is sometimes way too complex!
2 years ago
LordFrites
FiveBirds