This is advanced tool that will create new texture files for AI aircraft in your simulator. It requires knowledge of the installation paths of your simulator and how to use the command line within Windows. While it will not manipulate the original files you specify, it may have unintended side effects to your simulator installation if used incorrectly. You should have NO expectation of support for this tool or your simulator installation. You have been warned.
This tool will batch-convert textures for AI aircraft. It will automatically re-size and re-compress the textures to the size you specify. This can reduce the VRAM and CPU/GPU cycles necessary when using a simulator with a high number of AI aircraft visible. It can also clean up issues with differing texture formats across AI aircraft, improving your simulator's performance when you have a lot of AI aicraft around. A list of features:
Installation requires downloading and installing the Texture Optimizer. You can download from the link below:
Download Texture Optimizer 1.4 BETA (2023-09-10)
Once downloaded, do the following:
If you want to un-install the Texture Optimizer, you can do so from the Control Panel within Windows just like any other program.
Many textures in the new MSFS packages use new, optimized image compression that requires use of the GPU to decode properly without artifacts. To do so requires an open-source third-party tool called Compressonator CLI. Note: This installation is REQUIRED.
Download Compressonator CLI from Github
NOTE: You MUST download the CLI (Command Line Interface) version of Compressonator. The full GUI version will not work.
Once downloaded, do the following:
If you want to un-install Compressonator CLI, you can do so from the Control Panel within Windows just like any other program.
In addition to Compressonator, the Texture Optimizer requires a Microsoft tool called TexConv. This tool properly handles newer DirectX11 and DirectX12 texture compression formats that will cause issues with MSFS.
NOTE: You should download the texconv.exe file to the same directory as your Compressonator CLI tool, within the \bin\cli directory of your Compressonator installation. If you do not, the Texture Optimizer will not detect the proper installation of Texconv and fail.
Once downloaded, do the following:
Usage of the Texture Optimizer is via the command line. In most versions of Windows, it can be access by clicking on the "Start" button, typing "cmd" and hitting enter. Once you have a command window open, you will need to navigate to the folder where the Texture Optimizer is installed. You do this via the "cd" command. If you do not know how do to this, consider it a sign...Maybe this ain't the right tool for you. :-)
Once you are in the proper directory on the command line, use of the Texture Optimizer is as follows:
textureoptimizer -source <source folder> -resolution <image resolution>
-source
This should be the folder path for the AI texture files you want to optimize. As an example, if you want to optimize the textures for the FSLTL package for
Microsoft Flight Simulator, you would point this to the FSLTL directory inside your MSFS Community folder. During the installation of MSFS, if you set your
path to "D:\MSFS\Community" and you wanted to update the FSLTL package, you'd use:
"D:/MSFS/Community/fsltl-beta-airplanes"
-resolution
This should be the resolution to which you want the textures resized. Valid settings are:
A complete command line example:
textureoptimizer -source "D:/MSFS/Community/fsltl-traffic-base" -resolution 2048
Note: When you run the Texture Optimizer, it will search for an installation of Texconv and Compressonator. It will display the following text if detected, with the appropriate path for your installation displayed.
DIRECT3D TEXCONV INSTALLATION DETECTED IN D:\compressionator\bin\cli
If either Compressonator or Texconv is not installed correctly as described above, you will see one of the below messages and the Texture Optimizer will fail.
DIRECT3D TEXCONV INSTALLATION WAS NOT DETECTED. DIRECT3D TEXCONV IS REQUIRED BY THE TEXTURE OPTIMIZER.
DIRECT3D TEXCONV INSTALLATION DETECTED IN <installation path> Compressonator INSTALLATION WAS NOT DETECTED. IT IS A REQUIRED COMPONENT OF DIRECT3D TEXCONV. TEXTURE OPTIMIZER CANNOT CONTINUE.
In the same location as your source folder, a new directory will be created with "-OPTIMIZED" appended to the folder name. This will be the folder
that contains all the files processed by the Texture Optimizer.
Most AI packages contain thousands of files that are gigabytes in size. As a result, it will take a while for the Texture Optimizer to run. The command line will show the progress that is being made with a rudimentary percent complete scale. Converting textures is CPU-intensive. If you have a slower computer and significant AI packages downloaded (100s of airlines from AIG as an example) this process may take hours.
When completed, the Texture Optimizer will provide you with some statistics on what it processed, such as the number of textures and the resulting file sizes. All
the files it processes will be in the folder it created with the name ending in "-OPTIMIZED".
In order to use these textures, you need to move the original files out of the path of your simulator (The Community folder for MSFS, or the add-on specified folder for P3D). After you have moved the originals, you need to rename the "-OPTIMIZED" folder to the original name of your source folder. Simply remove "-OPTIMIZED" from the folder name.
-mipmaps
You can explicitly set how you would like mipmaps in the output files generated. There are three options:
auto
Will use the default mode for determining whether mipmaps should be generated. The Texture Optimizer makes this determination automatically, based on the
whether the input image contained mipmaps (if a DDS/DXT image), and if the output image size is greater than or equal to 512 pixels in dimension. If either of those
criteria are true, mipmaps will be generated.
on
Forces the generation of mipmaps for all textures, regardless of size, input format, or desired output format.
off
Explicitly prevents the generation of mipmaps for all textures, regardless of size, input format, or desired output format.
-mipmaps on
-dxt
You can explicitly set the DDS/DXT output format for textures. There are four options:
Note: You may observe odd visual artifacts within your simulator due to issues with alpha channels when forcing DXT1 or DXT3 formats.
auto
Will use the default mode for generating output textures. By default, all output textures will be converted to DXT5, unless the source texture was DXT1 or DXT3,
in which case it will preserve the same format.
DXT1
Forces DXT1 as the DDS output format for all textures, regardless of size or input format. Mipmaps may or may not be created, depending on optional -mipmaps
argument or automatic calculation of mipmaps generation.
DXT3
Forces DXT3 as the DDS output format for all textures, regardless of size or input format. Mipmaps may or may not be created, depending on optional -mipmaps
argument or automatic calculation of mipmaps generation.
DXT5
Forces DXT5 as the DDS output format for all textures, regardless of size or input format. Mipmaps may or may not be created, depending on optional -mipmaps
argument or automatic calculation of mipmaps generation.
-dxt DXT5
-resizesmaller
Specifies if images that are smaller than the target resolution should be resized (most often up-scaled) to the target resolution.
true
Will force the resize of all images, regardless of size, to the target resolution you specify.
false
Will only resize images that are the same size or larger than the target resolution you specify.
-resizesmaller true
-reformatsmaller
Defines whether images smaller than the target resolution should be reformatted into the specified image format.
true
Will reformat all images, regardless of size, to the specified output format (if "auto" is chosen as the output format, which is the default, it's processing
rules will be applied).
false
Will only reformat images that are equal to or larger than the specified target resolution.
-reformatsmaller true
-debuginput
Sets whether to write metadata of input textures to the console.
-debuginput true
-debugoutput
Sets whether to write metadata of output textures to the console.
-debugoutput true
-global <global texture directory>
EXPERIMENTAL. DO NOT USE YET. Sets whether to use a global texture directory to optimize duplicate textures that are identical to a global texture directory.
This is useful for AI packages that contain default textures like engine fans, lights, effects, etc. that are often included in third-party re-paints. This
often leads to extra disk usage and texture loading that can be avoided by using a global texture and specifying the texture.cfg properly. Useful for AIG
packages that use FSPXAI models.
-global "D:\msfs\Community\third-party-textures"
If you want to re-run the Texture Optimizer after updating existing packages, it will not process any files that exist in the output folder it creates. This will greatly speed up future runs of the Texture Optimizer as your AI packages grow or as you add new airlines. However, should you want to change the image resolution or otherwise re-process all the textures, you must DELETE the output folder that is created. When you do, use "SHIFT-Delete" on the keyboard to permanently delete the folder. Otherwise you will fill up your disk space with items in the recycle bin.
There are two primary reasons to re-run the Texture Optimizer. The first is when you add new AI packages, or one of the AI packages you use has updates to airlines or aircraft that include new textures. The second is when you want to re-generate new optimized textures for all AI aicraft.
Generating textures for new AI package updates:
Re-generating all textures: