tl;dr PVRTC encoder/decoder for Unity is a C# implementation of PVRTC texture format compression and decompression for Unity game engine. Only 4 bit modes supported. Downloads: Bitbucket repository View attachment pvrtc_encoder_and_decoder.unitypackage Why? Since AFAIK there isn't any existing C# implementation of PVRTC encoder/decoder. What I could do with this You can do runtime PVRTC compression in your iOS app/software. This could be handy if you are doing procedural texture generation and want to save some GPU texture memory. Or you could in certain situation save few download bytes by sending e.g. PNG textures to device and then converting those to PVRTC. How to use Import the Assets folder to your project. Check out PvrtcTest.cs for examples (there is also scene named pvrtcTest for testing the outputs) important functions are: EncodeRgb4Bpp(Texture2D bitmap) EncodeRgba4Bpp(Texture2D bitmap) and DecodeRgb4Bpp(byte[] data, int width) DecodeRgba4Bpp(byte[] data, int width) What could be better Performance could be better There could be a multithreaded version of encoder/decoder Encoder could read data from FILES instead of Unity Texture2d structures Decoder could guess the texture resolution from byte array size What it DOES NOT DO It does NOT support PVRTC 2 bit It does NOT open PVR files It does NOT generate PVR files Thanks jthlim and Brendan Duncan who made the C++ implementation that I shamelessly ported to C#.
@Agent_007 thank you this is very useful, we generate texture runtime for a car decal system and we need to compress them. As far as you know, is there anything for ETC encoding too? I found this old asset on the asset store (https://assetstore.unity.com/packages/tools/realtime-texture-compression-for-android-etc1-7724), but it doesnt support ETC2 (mandatory for the alpha channel).