How to get supported compressed textures formats?

Hello,

I would like to gather info about what compressed textures formats (e.g. ASTC, ETC) are most common among our players.

Does CC provide any way to retrieve this information?

We use version 3.7.2.

Thanks in advance!

You don’t need to, what you have to consider is “which formats you need to support on your target environment”, for example, if you are targeting old Android devices, then ASTC could be absent, and ETC2/ETC would cover more devices, you should have all needed formats set for your textures.
Our engine will check actual format availability in runtime, and choose from available resource format accordingly.
https://docs.cocos.com/creator/manual/en/asset/compress-texture.html

You can use gfx.deviceManager.gfxDevice.getFormatFeatures(gfx.Format.ETC2_RGBA8) to get the information. If the result is 0, the texture format is not supported.

1 Like