Add usage information and a screenshot

This commit is contained in:
leblane 2023-04-28 19:54:24 +03:00
parent e5e82457d2
commit d90d02e4d6
3 changed files with 21 additions and 3 deletions

View file

@ -1,6 +1,9 @@
# TextureTaffy # TextureTaffy
A utility to create compressed textures, in BC1 (DXT1), BC3 (DXT5), BC4, BC5, BC6(U)H and BC7 compression formats, with the [KTX File Format Version 2.0](https://registry.khronos.org/KTX/specs/2.0/ktxspec.v2.html) (KTX2) file format. A utility to create compressed textures, in BC1 (DXT1), BC3 (DXT5), BC4, BC5, BC6(U)H and BC7 compression formats, with the [KTX File Format Version 2.0](https://registry.khronos.org/KTX/specs/2.0/ktxspec.v2.html) (KTX2) file format.
Multithreaded, uses ispc_texcomp for compression, and stb_image for image loading.
![Screenshot](screenshot.webp)
## Requirements ## Requirements
@ -15,6 +18,21 @@ meson setup build [--buildtype=release] -Dcpp_std=c++17
meson compile -C build meson compile -C build
``` ```
## Usage
```
Usage: TextureTaffy [cube|array] <input> [input2, input3...] <output> <format> [fast|normal|slow|veryslow]
Formats:
BC1 - (DXT1) 5:6:5 Color, 1 bit alpha. 8 bytes per block.
BC1_SRGB - (DXT1) 5:6:5 Color, 1 bit alpha. 8 bytes per block.
BC4 - Greyscale, 8 bytes per block.
BC5 - 2x BC4 images. 16 bytes per block.
BC3 - (DXT5) BC1 Color, BC4 Alpha, 16 bytes per block.
BC3_SRGB - (DXT5) BC1 Color, BC4 Alpha, 16 bytes per block.
BC6H - 16 bit RGB, no alpha. Signed. 16 bytes per block.
BC7 - 8 bit RGBA - Good general purpose. 16 bytes per block.
BC7_SRGB - 8 bit RGBA - Good general purpose. 16 bytes per block.
```
## Notes and limitations ## Notes and limitations
* Uses stb_image for image loading. Therefore only supports radiance HDR images, not OpenEXR. * Uses stb_image for image loading. Therefore only supports radiance HDR images, not OpenEXR.

View file

@ -41,14 +41,14 @@ const std::map<std::string, std::tuple<std::string, int, vk::Format>> formats =
{"BC7_SRGB", {"8 bit RGBA - Good general purpose. 16 bytes per block.", 16, vk::Format::eBc7SrgbBlock}} {"BC7_SRGB", {"8 bit RGBA - Good general purpose. 16 bytes per block.", 16, vk::Format::eBc7SrgbBlock}}
}; };
const std::string usage = "Usage: TextureConverter [cube|array] <input> [input2, input3...] <output> <format> [fast|normal|slow|veryslow]"; const std::string usage = "[cube|array] <input> [input2, input3...] <output> <format> [fast|normal|slow|veryslow]";
int main(int argc, char ** argv) int main(int argc, char ** argv)
{ {
ISPCInit(); ISPCInit();
if (argc < 4) { if (argc < 4) {
std::cout << usage << std::endl; std::cout << "Usage: " << argv[0] << " " << usage << std::endl;
std::cout << "Formats:" << std::endl; std::cout << "Formats:" << std::endl;
for (auto & formatName : formatOrder) { for (auto & formatName : formatOrder) {
auto format = formats.at(formatName); auto format = formats.at(formatName);
@ -91,7 +91,7 @@ int main(int argc, char ** argv)
} }
if (numInputs < 1) { if (numInputs < 1) {
std::cout << usage << std::endl; std::cout << "Usage: " << argv[0] << usage << " " << std::endl;
return 1; return 1;
} }

BIN
screenshot.webp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB