Return to Website

MWGraphics Forum

none

MWGraphics Forum
Start a New Topic 
Author
Comment
Conditional batch converting

Hello, Martin!
I need add mipmaps in scores of bmp-textures. I can't use imagetool.exe because this tool (it seems that) destroy alpha (on batch converting) if mipmaps already presented in textures. (I just used this script:

Code:
imagetool -DXT3 -mip *.bmp
del *.bmp
ren *.mip *.bmp
)
And I need check mip-level before adding mipmaps in textures! Is it possible?
I found program ConvImX. Is it useful for my tasks?

Re: Conditional batch converting

Well convimx will create textures with mipmaps but it creates new textures from scratch so you will also be recompressing the main image. This is slightly different to "adding" mips (which implies keeping the main image unaltered and tacking the mips on after it using the same internal format). I suspect imagetool does the same (although I suppose it could be intelligent enough to avoid recompression if the output format is same as the input).
ConvimX won`t care if the file has mips or not initially. The output file will be the same for either (mipped with alpha)
Recompressing DXT data is never a good idea. Certainly not repeatedly. Recompressing will degrade the image data unless you are just working with 32 bit textures (which aren`t compressed)

I don`t have a handy tool that will check for the existance of mipmaps but it is a fairly simple programming task as this info is stored in the FS70 section of the bmp header.


I have some ideas floating around for a tool to non-destructively add or remove mipmaps from textures but I haven`t done anything yet

With your imagetool example you *could* just use the first line and then check the files. Any MIP files that were the same size as the matching BMP file would tell you that the original bmp already had mips and you could delete the MIP. Any where the MIP file is bigger than the BMP you would delete the BMP and then
ren *.mip *.bmp
to get all as bmp files
Can`t see any way to easily automate this though. It would require the manual deletions if you can only do this via bat. If you were writing a program to do it then you could do the check/deletions automatically but it isn`t something that could be done simply with dos commands