Browse Source

Add option for normal map swizzling

main
Andrew Cassidy 9 months ago
parent
commit
f6201e87f2
  1. 6
      Scripts/ddscompress.py

6
Scripts/ddscompress.py

@ -10,9 +10,9 @@ import dds
parser = argparse.ArgumentParser(description="Converts any number of textures to dds format. automatically chooses dxt1 or dxt5 depending on if the source image has anything in its alpha channel.")
parser.add_argument('files', type=str, nargs='*', help = "input texture files")
parser.add_argument('--format', type=str, choices=['auto', 'DXT1', 'DXT5'], default = "auto", help = "output texture format (default: %(default)s)")
parser.add_argument('--format', type=str, choices=['auto', 'DXT1', 'DXT5', 'DXT5nm'], default = "auto", help = "output texture format (default: %(default)s)")
parser.add_argument('--nomips', '-m', dest='mips', action='store_false', help = "Do not generate mipmaps")
parser.add_argument('--noflip', '-f', dest='flip', action='store_false', help = "Do not flip the image")
parser.add_argument('--noflip', dest='flip', action='store_false', help = "Do not flip the image")
parser.add_argument('--keep', '-k', dest='delete', action='store_false', help = "Do not delete originals")
parser.add_argument('--convertcmd', type=str, metavar='CMD', default=dds.convertcmd, help="name of imagemagick's convert tool (default: %(default)s)")
parser.add_argument('--compresscmd', type=str, metavar='CMD', default=dds.compresscmd, help="name of the nvidia dds compress tool (default: %(default)s)")
@ -36,6 +36,8 @@ with tempfile.TemporaryDirectory() as tempDir:
if (args.format == "auto" and dds.alpha(file) < 255) or args.format == "DXT5":
format = "-bc3"
elif args.format == "DXT5nm":
format = "-bc3n"
else:
format = "-bc1"

Loading…
Cancel
Save