Please integrate the powervr tool from imgtech

If you use the commandline PVR compression utility that comes from the imgtech with the pvrtextool here http://www.imgtec.com/powervr/insider/powervr-pvrtextool.asp

The resulting visual quality of the texture is notably better, and is the same exact size. This is a really serious issue to me because I need the superior image quality that the commandline PVR textool from imgtech provides, but unfortunately it’s a pain in the ass to have to use because it’s all through commandline! And unity’s nice workflow for texture importing and set up becomes null when having to use commandline tools, and I would much prefer to use unity’s workflow rather than commandline.

I imagine that Unity cannot legally include the commandline pvr textool. So would you please make it so we ourselves could download the pvr textool, and configure unity to use it instead of whatever comes with unity?

The commandline pvr textool is actually included in every unity osx build, otherwise you couldn’t even generate PVRs :slight_smile:

Also there is no problem using this tool and its output, since unity 3.1 or so, you can drag and drop pvr textures in from the outside, no need to generate them inside of Unity unless you want (or the restricted settings force you to)

Oh it is? Well then they just need to up the quality settings for it.

I do want to use the tool inside of Unity, and not the commandline converter. The commandline converter doesn’t provide as good of a workflow.

Unless do you have any tricks to using the commandline tool more efficiently? The best I could figure to improve workflow was to write an .sh script to convert all the textures in a folder automatically.

Doesn’t it also have a GUI (or is that windows only?) because the GUI version of the tool is pretty easy to use.

But yeah, having the superior compression algorithm in Unity would be preferable. Unless there is some drawback we’re not aware of.

There is a GUI version but I have the issue that my scene literally has like 100 1024x1024 textures all spread out in different folders and so it needs to be automated.

Have you done this yet? I wrote a script two years ago that did something similar for a different app. This was the first script I’ve ever written like this so I’m sure it’s terrible, but here you are. My source files were in a folder called “PNG Sprites”.

Hope it helps you get started. You might have to change the path to the texturetool binary and obviously you have control over the quality settings there as well.

#!/bin/sh

find . -regex '.*/PNG Sprites/.*\.png' -print0 | while read -d 

\0’ file
do
fileName=echo $file | perl -pe 's/.*Sprites\/(.*)\.png/$1/'
pvrName=“$fileName.pvrtc”

echo “Processing image: $fileName”
/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/texturetool -e PVRTC --channel-weighting-linear --bits-per-pixel-4 -o “$pvrName” “$file”
done

I got it working but the issue I ran into with the sh script is I could not figure out how to get it to convert an entire directory of images that had subdirectories, then spit out all the pvr into the same directory and subdirectory structure.

+1 to including an option for better quality compression (any performance drawbacks?)
instead of having to use the external tool.

maybe this should be in wish-list

Unity 3.4.2 comes with PVRTexTool Version 3.11 (located at /Applications/Unity/Unity.app/Contents/Tools). The most recent version available is PVRTexTool is 3.23, though what has changed I do not know.

Frustratingly I can’t find any option to request that Unity uses the command line option -pvrtcbest when converting. So at the moment I do all my texture conversion externally. Other than a more complicated pipeline, I have certainly not found any runtime performance drawbacks.

I also do my texture conversion manually. It is annoying and not a very happy situation. Also having trouble making unity load 16 bit pngs, for 16 bit output, without further messing it up. I am probably doing something wrong. Having far better 16 bit image creation would help - colour safe, dithering, dithering with alpha etc, all go a long way to a better looking app :slight_smile:

Perhaps this is a situation where asset store tools would help.

For as open as Unity claims to be to allowing you to do anything, it bothers me that little things like this are locked down.

You can write an entire visual scripting system in unity, but if you want to compress a PVR texture at a better quality inside the editor, out of luck.

This is a really stupid mistake on UT’s part as well, it’s like they didn’t even examine the PVR texture compression tool, or do any tests with it, before integrating.

Maybe this should be submitted as a bug?

Woah, I tried this

cd /Applications/Unity/Unity.app/Contents/Tools
mv PVRTexTool PVRTexToolOrig
nano PVRTexTool
#!/bin/bash
./PVRTexToolOrig "$@" -pvrtcbest
chmod a+x PVRTexTool

but my Unity 3.4.2f2 actually uses

/Applications/Unity/Unity.app/Contents/Tools/texturetool to generate its PVRTCs.

Try it, try renaming texturetool

Good news, Unity 3.5 uses PVRTexTool with the command line

-p -fPVRTC4 -pvrtcfast -iTemp/PVRT-Feed.png -oTemp/PVRT.pvr

With file names like that, multithreaded image conversion looks a way off!

Anyway. The good news is that by renaming PVRTexTool and replacing it with the bash script below, you can make it use best compression.

PVRTexTool:

#!/bin/bash
replcommand="$@"
exec /Applications/Unity/Unity.app/Contents/Tools/PVRTexToolOrig ${replcommand/fast/best}

But we shouldn’t need to. How absurd. Unity, how about a little fix for 3.5 final? a feather in your cap. A well-swizzled feather.

Couldn’t agree more.

I bet it would mess with the asset cache server. It’ll be >3.5 before you see it exposed.

Ignore my post below: totally missed this!

Wow Thanks a ton for this!

The difference is insane… it seems crazy to me that the tool isn’t set to best on default.
we’ve been trying to use uncompressed textures because the default Unity 3.5 pvr compression tool settings give terrible results.

You just made my day!

thanks again!

Using the best settings in Unity’s texture inspector iOS override doesn’t seem to make a big difference, just want to know how you guys do it manually. What should I type and where in the editor?