Khronos just released this online tool which may be useful…
Am I doing anything wrong or that’s how it’s supposed to work? there is a significant increase in disk size when using KTX2 with suppercompression
and the default settings.
Before | After | |
---|---|---|
DiskSize | 0.34mb | 1.26mb |
GpuSize | 21.33mb | 4.00mb |
— | — | — |
DiskSize | 0.89mb | 2.94mb |
GpuSize | 21.33mb | 4.00mb |
— | — | — |
DiskSize | 0.55mb | 2.02mb |
GpuSize | 21.33mb | 4.00mb |
With the damaged helmet model, total texture size went from 3Mb to 7Mb. Is there any recommended configuration to keep the disk size increase to a minimum?
maybe zip it
Yea, @Fennec , just zip it
I’m guessing that the discrepancies come from texture compression. JPEG is amazing at compressing images, it’s very lossy, but… umm… very compressy?
PNG is pretty great too, and it does actually use ZIP under the hood, it essentially zips all of it’s contents internally after applying a variety of encoding schemes. Trouble with JPEG and PNG - they are not suitable for partial decoding. JPEG is actually not too bad, hence majority of texture compression techniques (note, that I’m calling them texture compression techniques and not “image” compression) - are block-based, just like good old JPEG.
If you’re using JPEG originally, and you end up with a larger file size - you have 2 problems:
- JPEG is degrading image by quite a lot, so you shouldn’t be using it in the first place as your source.
- If your JPEG is smaller than basis texture you produce, it’s probably because your JPEG uses a higher compression ratio than the resulting basis texture. Meaning you’re taking something with very little real data and trying to represent it with more detail. It’s not that great of an idea. (not your fault, it’s the compression that made this decision, but to be fair to it - it’s hard to figure this out for software at that level)
If you’re using PNG - you should be getting smaller textures, unless there’s a lot of blank single-color space in the image, as PNG will compress that stuff really well. Otherwise PNG is typically quite a bit larger than basis.
I’d suggest playing around with compression settings and comparing image quality. It’s all a game of trade-offs. GPU ram usage is a super-important factor generally, as smaller RAM footprint makes shaders run faster, especially on lower-end devices.
Now that you both are mentioning that, it seems obvious. I just assumed KTX2 format was already compressed like a JPEG or a PNG that can’t be further zipped
Anyway, thanks and I’m just gonna zip it
What supercompression are you using? I’d typically use Zstd around level 18 or so. And are you using the UASTC or ETC1S image encoding?
ETC1S is smaller but it can be difficult to keep good quality, especially for normal maps. UASTC has better quality and is often larger on disk than JPEG or PNG, but it’s still much smaller in memory than either. Size on disk has little relation to size on GPU.
Common choice would be to use ETC1S for color textures and UASTC for non-color textures.