User Tools

Site Tools


en:tutorials:textures:compressedtextures

Compressed Textures on the iOS platform

use the right version of orx

Make sure your version of orx supports compressed texutures.

Creating compressed textures

Apple provides a tool called texturetool which will take care of compressing your textures. Details on how to do that can be found here. Note: Using texturetool will require you to flip your texture in y direction before processing. the backup PNG must however not be flipped!

However I would recommend using pvrtextool by imgtec, which produces better results for me. It can be downloaded here. It will flip the images in y direction by default, so no the above mentioned is not needed.

Here is a small bash script that will iterate over some textures and compress them. Note: The input textures must have power-of-two dimensions and must be square!

#!/bin/sh
for file in "$@"
do
ext=${file##*.}
name=${file%.*}
#texturetool -e PVRTC --bits-per-pixel-2 -f PVR -o "$name.pvr" $file &
PVRTexTool -f OGLPVRTC4 -premultalpha -i "$file" -pvrtciterations 8 -yflip1 &
done
wait

It can be invoked like this:

compressfiles.sh texturesfiles*.png

Now you can just use the resulting .pvr files instead of the pngs. Be sure to also distribute the png with your application, as they will be used instead of the compresed texture if the hardware doesn't support compression.

en/tutorials/textures/compressedtextures.txt · Last modified: 2020/08/31 07:11 (4 years ago) by sausage