- Mar 7, 2019
- 1,470
- 1,287
im onto another lead. found out about ASTC texture compression, much newer standard and much more flexible.what im not super sure about is visual quality. dxt1 is lossy, i had not realized this when i started looking into this. it compresses in 4x4 pixel chunks, so after compression you can see some artifacts in some cases. its especially evident in gifs, where the different pixel chunks have slightly different color shades and are pretty visible. the original gifs already had some artifacts due to small color palette, but dxt1 makes it a bit more noticeable when zooming in. still tho, very much usable from what i can see. might make it only compress images above a certain resolution later on.
with a 2000x2000 image:
RGBA is 15.3mb
DX1 is 1.9mb
ASTC 4x4 is 3.9mb
ASTC 5x5 is 2.5mb
ASTC 6x6 is 1.7mb
ASTC 8x8 is 0.98mb
ASTC 12x12 0.44mb
still lossy compression (there is no lossless compression with textures, needs to be linear when it reaches gpu and lossless compression is never linear), but a much newer format. ASTC 6x6 or 5x5 seems the best compromise, looks eons better than DXT1. astcenc has a quality parameter, 100 is very slow to compress but looks the best, 0 is instant but looks horrible, 80 is quite fast and looks the same as 100 to me.
for reference: astcenc-avx2.exe -cl in.png out.astc 6x6 80 -perceptual
then can view with "tacent view" which is a open source program for viewing textures (actually also uses imgui lol).
small problem: i cant seem to find how to load ASTC textures with opengl.
i think it just needs some parsing, cant find any good documentation for this but nothing some reverse engineering wont solve.
the real small problem: its a "new" format (2012), so some gpus might not support it. need to do more research on this.
Last edited: