Closed illwieckz closed 1 year ago
rust06e
$ crunch -quality 255 -file /tmp/rust06e.tga -out /tmp/rust06e-dxt5.crn
Apparent type: Normal map, Flags: R G B Non-Flipped
Input texture: 128x128, Levels: 1, Faces: 1, Format: R8G8B8
Input pixels: 16384, Input file size: 49196, Input bits/pixel: 24.021
Output texture: 128x128, Levels: 8, Faces: 1, Format: DXT5_AGBR
Output pixels: 21845, Output file size: 9364, Output bits/pixel: 3.429
$ crunch -quality 255 -noNormalDetection -file /tmp/rust06e.tga -out /tmp/rust06e-dxt5.crn
Apparent type: 2D map, Flags: R G B Non-Flipped
Input texture: 128x128, Levels: 1, Faces: 1, Format: R8G8B8
Input pixels: 16384, Input file size: 49196, Input bits/pixel: 24.021
Output texture: 128x128, Levels: 8, Faces: 1, Format: DXT1
Output pixels: 21845, Output file size: 3532, Output bits/pixel: 1.293
m77-blanc
$ crunch -quality 255 /tmp/m77-blanc.tga -out /tmp/m77-blanc.crn
Apparent type: Normal map, Flags: R G B Non-Flipped
Input texture: 32x32, Levels: 1, Faces: 1, Format: R8G8B8
Input pixels: 1024, Input file size: 3116, Input bits/pixel: 24.344
Output texture: 32x32, Levels: 6, Faces: 1, Format: DXT5_AGBR
Output pixels: 1365, Output file size: 771, Output bits/pixel: 4.519
$ crunch -quality 255 -NoNormalDetection /tmp/m77-blanc.tga -out /tmp/m77-blanc.crn
Apparent type: 2D map, Flags: R G B Non-Flipped
Input texture: 32x32, Levels: 1, Faces: 1, Format: R8G8B8
Input pixels: 1024, Input file size: 3116, Input bits/pixel: 24.344
Output texture: 32x32, Levels: 6, Faces: 1, Format: DXT1
Output pixels: 1365, Output file size: 356, Output bits/pixel: 2.086
Image | Format before | Format after | Size before | size after |
---|---|---|---|---|
rust06e |
DXT5_AGBR | DXT1 | 9364 | 3532 |
m77-blanc |
DXT5_AGBR | DXT1 | 771 | 356 |
It looks like crunch
only produces DXT5_AGBR
files with normal maps, not non-normal maps.
We already use -DXn
format for normal maps, so anytime we don't use -DXn
we can set -noNormalDetection
because we already know the files are not normal maps, and then we never run code that may pick the specific swizzled AGBR format, formats we never need.
Add
-noNormalDetection
to avoid normal map detectionCrunch has an algorithm to try to detect normal maps, probably to pick higher quality compressors.
It prevents the compressor to wrongly detect a normal map and select formats like
DXT5_AGBR
whenDXT1
is good enough.It does not only avoid to produce files in less supported swizzled formats, it also allows to pick smaller formats, sometime saving half of the produced file size.