I realized I never shared the script I'm using to convert textures to the best-fitting Dreamcast format. So here it is, integrated into an example Makefile (which I suggest because texture conversion can be slow and this way it's also parallelizable).
It uses texconv by tvspelsfreak and ImageMagick for conversion/analysis.
Hope somebody will find it useful in making games.
- Converts to paletted texture if unique color count is low enough
- Converts to bumpmap format if filename is of the form *_normal*, *_bump*, *Normal* or *Bump*
- Uses A1RGB5 format if only 2 unique alpha colors are used (alpha mask), ARGB4 if more unique alpha values exist, R5G6B5 if alpha is always the same.
- Resizes textures of size >1024x1024 to 1024x1024.
- Bumpmaps are VQ compressed, but quality suffers a lot because of high count of unique colors, so resolution is reduced to 512x512.
- Generates mipmaps for square textures, unless disabled.
- Creates preview png.
Code: Select all
dc_convert_texture -i in.png -o out.dtex [-p preview.png] [-b] [-h] [-d] -i/--in in.png Input texture file to convert. Required. -o/--out out.dtex Destination path of converted texture. Required. -p/--preview preview.png Destination path of preview texture for checking quality reduction. -b/--bumpmap Input texture will be converted to bumpmap format. If the filename contains "_bump", "_normal", "Bump" or "Normal" this is set automatically. -d/--disable-mipmaps Disable generation of mipmaps. Use for textures which are always shown on screen unscaled and without rotation. -h/--help Show this help message.