PDA

View Full Version : Batch texture converters



Tweek
September 29th, 2008, 12:50
Just wondering how to create a batch file that'll convert all DDS files with no MIPs to ones that do have MIPS (DXT5 preferably). Although some have issues with blurry textures when they have MIPs, if they don't have MIPs, I have issues with jagged textures when viewed from afar.

Anyway, it doesn't really need to be explained, as I simply want something that'll do the job! Any help would be appreciated. :ernae:

JT8D-9A
September 29th, 2008, 13:12
imagetool -nobeep -dxt5 -dds *.dds

Of course you can change "-dxt5" to -dxt3 or -dxt1..

Tweek
September 29th, 2008, 13:23
Thanks very much! Works a treat.:applause:

JoeW
September 29th, 2008, 13:25
Nils ...... That could have saved me almost a day when I converted the Carnado Piper P-180. I posted that thread just before the forum crashed.
Thanks .... I made a copy.

Tweek
September 29th, 2008, 13:54
I'll hold back my "works a treat" comment, just for a little while, as it seems to have converted them in some bizarre way! It converts them to DXT5 with MIPs, no problem, but it also seems to have done this to every file:

55660

Any ideas?

GypsyBaron
September 29th, 2008, 14:50
I'll hold back my "works a treat" comment, just for a little while, as it seems to have converted them in some bizarre way! It converts them to DXT5 with MIPs, no problem, but it also seems to have done this to every file:

55660

Any ideas?


DDS files are 'inverted' from what you would see with a BMP
file, however you may be asking about some other feature
which, without something to compare to, I couldn't address.

I do know that a few weeks ago I went through a mass texture
converting exercise with all my AI textures.
I converted the BMP's to DTX3 or perhaps it was DTX5 initially.
I seemed to see an increase in system stuttering as a result so
went on to convert the textures to DTX1 and resize to 512x512.
THAT was a mistake as any 'chrome' was completly washed out
and many of the textures became severly pixelated.

Fortunately I had backups and was able to restore back to the
originals ( BMP's ) and am going to reattempt the conversion
first to DTX3 and see if performance improves, Then I may
do a batch resize from 1024 down to 512.

I have created batch files that work on an entire directory
structure, looking for BMP's in texure folders and converting them
or resizing them. Since all my AI are in two unique main directories
( AI and Military AI ) I can work on them with this batch method.

Paul

Tweek
September 29th, 2008, 14:58
however you may be asking about some other feature
which, without something to compare to, I couldn't address.

This is how it should look:
55666

Seeing as it deviates from the standard flipping, pixelation, discolouring, or distorting that you might expect, this just seems to have gone over it with a glowing paint brush! Never seen anything quite like it, so I'm stumped...

GypsyBaron
September 29th, 2008, 15:26
This is how it should look:
55666

Seeing as it deviates from the standard flipping, pixelation, discolouring, or distorting that you might expect, this just seems to have gone over it with a glowing paint brush! Never seen anything quite like it, so I'm stumped...

That is similar to what I saw when I did all my conversions.

What format is the original and what format did you convert to?

Something obviously went haywire there....

BTW, imagetool will run recursively with a -r option included.

Paul

Tweek
September 29th, 2008, 15:30
Not entirely sure how to find out the exact format of the original DDS files (perhaps someone else with the IRIS T-6 could assist), but they've been converted to DDS DXT5 with MIPs.

JT8D-9A
September 30th, 2008, 00:36
OMG, that's my fault - sorry! :redf: I forgot the "-nodither" switch: imagetool -nobeep -nodither -dxt5 -dds *.dds

You have to reinstall the T-6.

BASys
September 30th, 2008, 03:20
Hi Folks

Just a Heads Up [:D]

Be aware -

Converting any model's textures
to a different suffix from those existing in the .mdl file,
e.g.
From .BMP to .DDS

Will add an I/O calls overhead,
and may introduce some stuttering when changing views.

The model is still calling for .BMPs,
and will therefore parse/search all fallback paths
before it substitutes the DDS textures for those originally called.


YMMV with stuttering,
depending on your PC's capabilities and config.



HTH
ATB
Paul

JT8D-9A
September 30th, 2008, 03:26
I use a hex editor (Hex Editor MX) to rename BMP to DDS in the model.

Tweek
September 30th, 2008, 09:27
OMG, that's my fault - sorry! :redf: I forgot the "-nodither" switch: imagetool -nobeep -nodither -dxt5 -dds *.dds

You have to reinstall the T-6.

Not a problem! Thanks for the fix.

Tweek
September 30th, 2008, 10:05
After reinstalling and testing, it still seems to be creating that strange effect. I've definitely edited the batch file as you've said to, so perhaps there's another underlying problem?

JT8D-9A
September 30th, 2008, 10:55
Hmm that was the only difference to my batch files and i have never seen this before. But i usually don't use MIPs for my aircraft i fly.
Now i tested it with the PC-9 and i get the same problem. The normal conversion to DXT5/DDS is working, but only without MIPs.
With MIPs it only works when i do it manually.

EDIT: Have you tested the texture in FSX?

Tweek
September 30th, 2008, 11:35
They show exactly as they do in the bitmap in FSX.

GypsyBaron
September 30th, 2008, 11:40
Hi Folks

Just a Heads Up [:D]

Be aware -

Converting any model's textures
to a different suffix from those existing in the .mdl file,
e.g.
From .BMP to .DDS

Will add an I/O calls overhead,
and may introduce some stuttering when changing views.

The model is still calling for .BMPs,
and will therefore parse/search all fallback paths
before it substitutes the DDS textures for those originally called.

YMMV with stuttering,
depending on your PC's capabilities and config.

HTH
ATB
Paul

Thanks for the reminder on this, Paul.

I was aware of this but didn't expect to see such a drastic
adverse effect on my system, but then I have several
hundred AI models and many more paints.

For now I'm staying with my original BMP textures until I
can find the time to hex edit the mdl files to look for DDS
textures first...a rather daunting task that I don't think can
be relegated to batch processing :(

FSX has some strange default load/search conditions that become
obvious when using Filemon. Early on I changed all of my 'aircraft.cfg'
files to 'sim.cfg' since that's the first 'choice' for FSX.
Also, it will look for gauges in a local folder before it looks for
them in a CAB and then ion to the main gauges folder, which
is good if you are into tweaking XML gauges :)

Paul

JT8D-9A
September 30th, 2008, 11:40
@Tweek
Maybe this works: http://www.box.net/shared/6zboxv6fg1
You only have to change the number of MIPs, if you have a different resolution than 1024... or you can try it without "-m #", maybe they will be generated automatically.

Tweek
October 1st, 2008, 06:37
Hmm, that doesn't seem to have any effect on the files at all. You'd think it would be a little simpler than this, wouldn't you? :banghead: :costumes:

JT8D-9A
October 1st, 2008, 06:56
It works on my system. I tested it with a 4MB, 32Bit DDS texture, which is now a 1,366MB DXT5 DDS Texture with 9 Mips. I hope you used the bat and not the exe...

Tweek
October 1st, 2008, 07:37
I'm putting the bat and exe in the texture folder, then running the bat. It quickly flashes up with the little cmd window, with some text, then quickly closes again before I get a chance to read what the text says. All of the textures stay at 4Mb.

JT8D-9A
October 1st, 2008, 07:50
What format do your textures have? If they are BMPs, you have to change "*.dds" to "*.bmp" in the bat file.

Or you might try to convert only one or two files in a separate folder. Maybe the source files have to be in the same format.

I just tested it with 4 4MB files and it really works.

Tweek
October 1st, 2008, 08:25
Definitely DDS files. Tried removing every other file in the folder, except one DDS, and it didn't even convert that!

After all this time, I probably could have converted each file individually in Photoshop. :icon_lol:

Tweek
October 1st, 2008, 09:39
Ah well, I've found a program that does the trick just as well (simply called DDS Converter 2). Converts them perfectly, with mipmaps, so I guess I don't need a bat file. Thanks for all your help anyway, and hopefully it's helped out others, too.

JT8D-9A
November 9th, 2008, 03:04
OK, i have found the reason why it didn't worked on your system.. the DX SDK has to be installed to use the tools:kilroy:
Too late for you, but maybe helpful for others...