BinomialLLC / basis_universal

Basis Universal GPU Texture Codec
Apache License 2.0
2.7k stars 263 forks source link

Question about conversion from PNG to KTX2 and BC1-7 #371

Closed kaphula closed 7 months ago

kaphula commented 7 months ago

Hey,

Does basis_universal support conversions from PNG to KTX2 with BC1-7 compression formats?

The help states:

-ktx2: Write .KTX2 ETC1S/UASTC files instead of .basis files. By default, UASTC files will be compressed using Zstandard unless -ktx2_no_zstandard is specified.
 -ktx2_no_zstandard: Don't compress UASTC texture data using Zstandard, store it uncompressed instead.

So does this mean no support for BC1-7?

Thanks!

thokra1 commented 7 months ago

You're mixing up stuff here. BasisU is not a BCn compressor - but BCn is supported as a transcoding target. ZStandard compression is another compression step, on top of the texture compression that's done when going from input data to UASTC.

On the platform where you compress, the vastly simplified pipeline looks like this:

Input -> UASTC [-> Zstandard] -> { .ktx2 | .basis }

On the runtime platform, you simply transcode to whatever format is supported there. On desktop systems, like usual PCs and Macs, you got S3TC/DXTn and BCn (or BPTC + RGTC in OpenGL terms). On mobile, you mostly have ASTC etc.

I suggest you close this, because there isn't an issue here.