4

我一直在使用终端将jpg名为 left 的图像转换为pvrtc格式,这发生了:

/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/texturetool -e PVRTC --bits-per-pixel-2 -o left.pvrtc left.jpg  
Failed to load image  
Failed to perform Encode
4

1 回答 1

2

改变:

/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/texturetool -e PVRTC --bits-per-pixel-2 -o left.pvrtc left.jpg

至:

/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/texturetool -e PVRTC --bits-per-pixel-2 -o left.pvr left.PNG

文件必须是 PNG

更新了 OSX 10.10+ 的说明

在终端中,点击cd以确保您位于根目录中。

cd /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/ && ls

这应该会向您显示所有工具的列表(确保您看到texturetool) - 如果没有,请更新您的操作系统,然后更新 Xcode

一旦你知道它在那里,cd回到你的根目录并运行这个工具,比如:

/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/texturetool -e PVRTC --bits-per-pixel-2 -f PVR -o [new path to pvr to go] [path of original png]

您的输出 pvr路径可以是~/whatever/image.pvr,您的输入是 png转换的图像的路径。

HEREHERE是其他很好的演练

其中iPhone SDK包括一个工具,可让您以 PVRTC 压缩格式创建纹理,恰当地命名为texturetool. 如果您在默认位置 (/Developer/Platforms/) 中安装了 Xcode 和 iPhone OS 2.2 SDK,则texturetool位于:/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/texturetool.

texturetool允许您创建四种PVRTC数据变体,主要区别在于质量和大小之间的权衡。您将不得不对这些变体进行试验,以确定哪种设置是每个单独纹理图像的最佳折衷方案。

pvrtc有了文件后,这里有一些相同的代码可以提供帮助

这里还有一些文档

这里PVRTC是关于东西的好读物

于 2016-02-10T02:39:42.370 回答