Performance slightly worse, quality far worse, when using texture compression (dxt.ktx)

I’ve for awhile assumed that part of the performance issues I’ve had with my game are due to the large amount of textures (card game, lots of images) I use, even though it is quite optimized at this point – I basically use 512x512 for most things, and 5 1024x1024, but as they appear in many different scales, I thought I would get a performance increase by compressing / pre mip mapping them, but I’m seeing strange results after trying.

Not only is the performance slightly worse when doing so (when looking at BJS inspector GPU frame time mainly), but they look much worse on screen, very jagged edges, etc. – I understand obviously that they are being compressed so some loss of quality is to be expected, but it’s really at an unusable quality. Quality aside for now:

My main question, is, shouldn’t I see a performance increase regardless? I’d say at an average game state, there are probably at least 15-20 unique textures, just between card frames and images, on screen at a given time. The frames are the 1024, all the other images are 512. – Shouldn’t I see a performance increase from that or am I misunderstanding?

Edit – Actually the number is more like at least 25-35 at a given time, because BJS doesn’t support mesh based sprite sheeting, so I have to do incredibly wonky things like load the numbers 0-9 as 512 textures and source/instance mesh them, rather than have 1 source mesh for all numbers. And the numbers are actually the thing that brings the compression to “unusable quality” (loading them from 512 textures is the only way I’ve been able to get DECENT looking numbers without resorting to GUI texture for everything which was killing performance)

This is really strange indeed, could you tell us more about the compression setup and platform you are running on ?

Remember, mip maps are generated into the file, not computed at load time for ktx files. Also, I don’t think there’s quality degradation, which is why I am making the wild guess there’s no mip maps in the files.

1 Like

Ya mipmaps should be there, I don’t think I’d be seeing a size increase in the raw textures if not.

I am using texture-compressor node library, with command like this (m flag for mipmap)

texture-compressor -i #{input_path} -o #{output_path} -t s3tc -c dxt3 -y -m

I am only targeting PC/Mac ATM so don’t need to worry about non desktop formats