Archived

This topic is now archived and is closed to further replies.

Bjoern

DDS Mass Texture Converter

Recommended Posts

Well, by principle, this batch script is nothing new as batch scripts calling Imagetool to convert texture files have been around since FS9.

This one, is a bit more than "just" a conversion script though.

 

 

Features:

- A script-based user-interface

- Converts .bmp to DXT5 .dds files (with or without mip-maps)*

- Supports backup and backup restore operations

- Works with *.bmp files only, i.e. other files are not backed up to save disk space

- Can convert large (e.g. all AI aircraft) and small (e.g. a single aircraft) folders

- As Imagetool tends to skip converting some files in large folders, the script also checks for unconverted files

- Supports blacklisting, i.e. for panel bitmaps or similar

 

 

 

*Well, a conversion to DXT5 .dds is nothing new, but it could help saving the odd GPU cycle as the GPU won't have to flip each texture around while rendering it. Texture rendering in DX10 mode might also benefit.

 

 

 

Usage:

 

1. Unzip to a place with enough disk space available**

2. Run Converter.bat

 

** The backup folders will be created in the folder Convert.bat is located!!

 

 

Notes:

 

1.) I do not intend to destroy your FSX installation. I've tested this tool in a contained environment as well as on my own FSX installation and it left everything intact!

 

2.) CREATE A BACKUP BEFORE DOING ANY(!) CONVERSION WORK

 

3.) Make sure to read any instructions and notes on-screen when using this tool! I didn't add them for nothing!

 

4.) I've added a safeguard when entering folder paths, i.e. if the specified folder does not exist, you will be thrown back to the main menu. So it's harder to mess up by entering the wrong path to a folder.

 

5.) Creating or restoring backups and converting textures can take a very long time. On a SSD, converting my 11 GB AI aircraft folder took over an hour

 

6.) Backups can be amended in case you're adding new files to your FSX installation at one point

 

7.) Conversion is an iterative process. You will need to do more than one pass in large folders.

 

8.) DO NOT rename or delete the "ZZZ_Helper" folder! You *will* break this script!

 

9.) The conversion process also fixes the "Missing Alpha" issue

 

 

Download:

 

http://www.mediafire.com/download/66vaa7226k76g6b/DDSConverter.zip

 

 

Any fearless volunteers?

Share this post


Link to post
Share on other sites
Help AVSIM continue to serve you!
Please donate today!

I'll give it a shot later today,

 

Which folders do I need to back up specifically.

Share this post


Link to post
Share on other sites

If you convert the textures from BMP to DDS, wouldn't you also have to edit the terrain.cfg file with the updated file extensions in order for it to work and find the new textures?

Share this post


Link to post
Share on other sites

Hes talking about converting aircraft textures, they dont care abt ext will work with bmp, or dds

Share this post


Link to post
Share on other sites

Which folders do I need to back up specifically.

 

Whatever you want to work with. But the tool is supposed to do that automatically for you.

 

 

If you convert the textures from BMP to DDS, wouldn't you also have to edit the terrain.cfg file with the updated file extensions in order for it to work and find the new textures?

 

I haven't tested it with ground textures. Only AI aircraft and all of my add-on sceneries.

 

 

Hes talking about converting aircraft textures, they dont care abt ext will work with bmp, or dds

 

So do sceneries.

Share this post


Link to post
Share on other sites

A word of caution: Before you convert any user aircraft, make sure to put the names of any 2D panel bitmaps into a text file.

 

See also the annotation in the "Back up, Convert, Restore", etc... submenu.

 

 

Example:

 

A Beech 1900D's folder in "SimObjects\Airplanes" is named "Beech 1900D". So you create a .txt file named "Beech 1900D.txt" in "ZZZ_Helper".

In this text file, you put the names of the 2D panel pitmaps. The file extension is irrelevant.

For the 1900D, the file would contain

B1900D.*FUELPANEL.*overhead.*Switches.*
After the conversion process, the tool will scan for such a blacklist and restore the bitmaps in it from the backups. You hence won't lose your 2D panel bitmaps after converting everything else.

 

 

 

 

A note about Scenery\World\Texture:

I have not tested a conversion of this folder. It could be that FSX reacts in the same way as with its could and sky textures, i.e. crash upon startup.

If someone decides to give it a try, make sure to replace all relevant ".bmp" extensions with ".dds" ones in your texture.cfg.

 

 

 

 

 

I must be convert with or without mipmap ?

It's your choice.

 

Mipmaps = slightly faster, bigger texture file size.

No mipmaps = slightly slower, smaller texture file size.

Share this post


Link to post
Share on other sites

If one wants to be perfectly safe, one can still do a manual backup of any folder to be converted before ever running my tool.

That way, all it takes is deleting the effed up version and moving the backed up one into place, should something go wrong.

 

But as I've said...it worked for my entire custom scenery and AI folder.

Share this post


Link to post
Share on other sites

I have done the conversion of "Texture" and "Effect\texture" folder, tested it and I did not see difference in smoothness and performance. Others experience?

Share this post


Link to post
Share on other sites

I have done the conversion of my "Scenery\World\Texture" folder with mipmap and without mipmap and modified my "terrain.cfg" too (changed all "bmp" extensions to "dds") with "replace" function.

 

-With mipmap I had several "Unknown error" message towards the end of coversion process. The texture size changed from 682.7kb. to 1.3MB.

The sim was unusable ! Corrupt, recurrent, deficient textures, and mixed water textures everywhere !

 

-Without mipmap I had a lot of "Unknown error" message during coversion process ! The texture size changed from 682.7kb. to 1MB.

The sim was unusable ! Corrupt, recurrent, deficient textures, and mixed water textures everywhere too !

 

And finaly I don't understand, why the compressed "dxt5" file size bigger than the uncompressed "bmp" file size ! Esspecially without mipmaps.

 

This was a time-consuming and inefficient test to me :(

Share this post


Link to post
Share on other sites

Did it on my add-on scenery folder, so far so good, thinking about my Aircraft AI folder next. 

 

Then maybe sim-objects, Once I get the panel.bmp thing figured out.

Share this post


Link to post
Share on other sites

Unfortunately there is nothing to be gained performance wise by converting .bmp to .dds. and if there was and it was that simple of a thing to do, ACES would have done it in the first place or done it when the made SP1 or SP2. You'll notice that by default ACES packaged FSX with both bmp and dds files for certain items.

 

If you had the same texture in FSX both in .dds and .bmp format you would see that the bitmaps would be identical as would be the file properties. The only difference is the packaging and that the .dds file would be flipped upside down and backwards. It would then be up to DirectX to flip the texture right side up but still leave it backwards if a .dds is found, and if a .bmp is found, DirectX would simply flip it backwards.

 

DirectX is fast enough that the processing time for either .dds or .bmp is about equal and converting .bmp to .dds is not going to make any difference, especially as fast as todays hardware is. The main reason that there are some files by default in FSX as .dds is that .dds files are required in some instances for correct specular and bump mapping. Hence the reason some a/c and scenery use .dds for some files and .bmp for others.

 

This is one of those tweaks or adjustments of texture files that is better left alone and not messed with in the FSX internal structure.

 

 

 


I have done the conversion of my "Scenery\World\Texture" folder with mipmap and without mipmap and modified my "terrain.cfg" too (changed all "bmp" extensions to "dds") with "replace" function.

 

 

 


The sim was unusable ! Corrupt, recurrent, deficient textures, and mixed water textures everywhere !

 

That's because the FSX render engine wont recognize .dds files in the Scenery/World/Texture folder, it only recognizes .bmp files.

Share this post


Link to post
Share on other sites

I have done the conversion of "Texture" and "Effect\texture" folder, tested it and I did not see difference in smoothness and performance. Others experience?

 

Of course not. The performance impact is negligible.

 

By converting the textures, you will have them compressed in the best way available (DXT5) and in FSX' native texture file format (DDS).

As a bonus, the conversion process correctly sets the "alpha" channel of each texture, which means eliminating a possible source of stutters when loading textures (similar to what DXTFixerX does).

 

 

 

...

 

This was a time-consuming and inefficient test to me :(

 

Thanks for testing anyway.

 

Did you use the "Restore Backup" function? Did it work as intended?

 

 

 

Did it on my add-on scenery folder, so far so good, thinking about my Aircraft AI folder next. 

 

Then maybe sim-objects, Once I get the panel.bmp thing figured out.

 

Thanks for the feedback!

 

See:

http://forum.avsim.net/topic/413917-dds-mass-texture-converter/#entry2720014

 

The code tags have mucked up the formatting though. Each entry in the text file has to go into a new line.

E.g.

panel1.*

overhead.*

pedestal.*

 

I do not recommend converting your entire SimObjects folder though. Work one plane at a time.

 

 

How many passes did you do on your scenery files, by the way? Or did Imagetool converted them all in the first one?

 

 

 

 

This is one of those tweaks or adjustments of texture files that is better left alone and not messed with in the FSX internal structure.

 

 

That's because the FSX render engine wont recognize .dds files in the Scenery/World/Texture folder, it only recognizes .bmp files.

 

I'm not trying to mess with (much of) FSX' internals. It's more a means of putting huge amounts of textures from add-ons into a uniform format.

Also, it was a great exercise in batch file programming.

 

 

So it's the same with cloud and sky textures. no other format than uncompressed .bmps.

Share this post


Link to post
Share on other sites

Bjoern, on 21 Jul 2013 - 11:54 AM, said:

By converting the textures, you will have them compressed in the best way available (DXT5)

Which really only matters if the Alpha is a complex one and will make no difference to any texture that has previously been compressed.

 

In fact some will say that compressing an already compressed file can only hurt quality.

 

Bjoern, on 21 Jul 2013 - 11:54 AM, said:

...and in FSX' native texture file format (DDS).

Which will only impact objects that are made with FSX materials. Anyone that is making objects with FSX materials and not using .DDS needs to do some studying. And if .DDS is an FSX requirement, why did ACES include so many .bmp textures?

 

Bjoern, on 21 Jul 2013 - 11:54 AM, said:

As a bonus, the conversion process correctly sets the "alpha" channel of each texture, which means eliminating a possible source of stutters when loading textures (similar to what DXTFixerX does).

I agree this needs to be done, I would caution anyone against using batch tools to fix this issue.

 

No disrespect intended, I simply do not want to risk anything, including my time, by turning loose a tool that could cause widespread issues.

 

Thanks for providing it anyway.

 

regards,

Joe

Share this post


Link to post
Share on other sites

Can you write the batch converter so it does not convert the night "L" textures.  I have been told those textures should not be converted.

Share this post


Link to post
Share on other sites

 

 


I'm not trying to mess with (much of) FSX' internals. It's more a means of putting huge amounts of textures from add-ons into a uniform format.

 

But why would you want to do that if there is a chance of causing problems and the performance wont be increased?

 

If a texture is supposed to be in .bmp format per the design of the addon, why would you want to change that? Not only that but mass texture converting isn't a good idea if you dont first go through all the textures and sort out all the DXT1's prior to making everything DXT3/5. Sometimes addon a/c and sceneries have DXT1 textures mixed in with DXT3/5's and you certainly dont want to up-convert DXT1's to DXT3/5's.

 

Dont get me wrong, sometimes developers do things by accident or not as well as they should be done, but for the most part the only things that need to be done with addons is adding mip-maps, alphas, or converting a 32bit textures to DXT5 or lower. Making textures that were ,bmp to .dds isn't going to help anything unless it should have been .dds in the first place due to developer design error.

Share this post


Link to post
Share on other sites

...

 

Fair enough.

 

 

 

 

Can you write the batch converter so it does not convert the night "L" textures.  I have been told those textures should not be converted.

 

If you don't want to have them converted, just blacklist them.

 

 

 

 

But why would you want to do that if there is a chance of causing problems and the performance wont be increased?

 

Why did we go to the moon?

 

Because we could.

 

 

 

 

And as I've said, it was primarily an exercise in complex batch file programming. Use it or don't.

Share this post


Link to post
Share on other sites

Okay I have done My Traffic, Addon scenery, and UK2000(lots of airports in there).

 

No problems thus far, I didn't measure performance before I did it, but nothing is (so far) broken.

 

We'll see if any additional stability problems pop up, I have backups of all the folders.

 

So I guess I can thus far conclude that your Batch file does not completely destroy everything it touches LOL.  Thank you.

Share this post


Link to post
Share on other sites

Okay I have done My Traffic, Addon scenery, and UK2000(lots of airports in there).

 

No problems thus far, I didn't measure performance before I did it, but nothing is (so far) broken.

 

We'll see if any additional stability problems pop up, I have backups of all the folders.

 

So I guess I can thus far conclude that your Batch file does not completely destroy everything it touches LOL. Thank you.

Excellent, thanks for the feedback!

 

 

 

 

 

 

 

 

Some stuff used in this tool is also usable for a repaint installer. I'm not done with that one yet though.

Share this post


Link to post
Share on other sites