Nic*_*ico 3 ios opengl-es-2.0 powervr-sgx
我正在使用我今天下载的最新的pvrtextoolCL.
问题是它没有生成与apple的texturetool相同的标题或者它的在线文档中的标题.如果我在gui工具中使用遗留保存,它可以工作,但我需要命令行工具的选项.
是否有其他人遇到此问题,我该怎么做才能解决这个问题?
如果Legacy Save As选项适用于您,则您的代码将解析版本2 PVR Texture标头.最新的PVRTexTool和PVRTexToolCL都使用版本3标头格式V3.
如果您需要命令行,您也可以
A)使用-pvrlegacy作为命令行参数
B)使用Apple提供的texturetool和XCode来压缩纹理
C)更新代码以解析版本3 PVR纹理标头
版本2 PVR纹理标题
typedef struct _PVRTexHeader
{
uint32_t headerLength;
uint32_t height;
uint32_t width;
uint32_t numMipmaps;
uint32_t flags;
uint32_t dataLength;
uint32_t bpp;
uint32_t bitmaskRed;
uint32_t bitmaskGreen;
uint32_t bitmaskBlue;
uint32_t bitmaskAlpha;
uint32_t pvrTag;
uint32_t numSurfs;
} PVRTexHeader;
Run Code Online (Sandbox Code Playgroud)
版本3 PVR纹理标题
typedef struct _PVRTexHeaderV3{
uint32_t version;
uint32_t flags;
uint64_t pixelFormat;
uint32_t colourSpace;
uint32_t channelType;
uint32_t height;
uint32_t width;
uint32_t depth;
uint32_t numSurfaces;
uint32_t numFaces;
uint32_t numMipmaps;
uint32_t metaDataSize;
} PVRTexHeaderV3;
Run Code Online (Sandbox Code Playgroud)
如果您要解析版本3纹理标头,请从以下位置获取PowerVR SDK:
http://www.imgtec.com/powervr/insider/sdkdownloads/index.asp
并查看PVRTTexture.h标头.它将包含所有枚举以定义标志,以及元数据的其他结构.SDK中还有示例代码来读取文件并将其加载到OpenGL中.