I download a series of textures on the iPhone, using the WWW class.
When I download them they are RGBA format.
To conserve memory I want to change them into PVRTC.
How can I do this?
I download a series of textures on the iPhone, using the WWW class.
When I download them they are RGBA format.
To conserve memory I want to change them into PVRTC.
How can I do this?
It's not going to happen, there is no functionality to compress to PVRTC at runtime, and it would take an extremely long time to do it anyway. (It's time-consuming enough on a desktop CPU, never mind mobile.)
I have managed to solve this for Android. I think the same method can be applied for iOS as “the beef of the code” is relying upon standard OpenGL API.
I’ve uploaded a functional demo of my solution to this problem:
There are two projects:
One thing I’d like to ask from you: When one (or some) of you guys port this to iOS (I haven’t yet taken the time), please send me a copy of the code (or post here)!
The idea:
At the time of writing, I didn’t have a PowerVR equipped Android at my hands but I’ve made it working with PVRTC4 the same way some time ago. It’s just about making sure that …
All in all, I think the code is fairly straight-forward, easy to read (not that elegant, though) and shows the common pitfalls to avoid.
I hope this helped, please let me know!
I found the answer in the documentation (of course):
Texture2D lTexture = new Texture2D(lWidth, lHeight, TextureFormat. your format here, false);
// assign the downloaded image to the main texture of the object www.LoadImageIntoTexture(lTexture );