ios - pvrtextool cl 不生成标准 header

标签 ios opengl-es-2.0 powervr-sgx

我使用的是我今天下载的最新 pvrtextoolCL。

问题是它生成的 header 与 apple 的 texturetool 或其在线文档中的 header 不同。如果我在 gui 工具中使用 legacy save out,它可以工作,但我需要命令行工具的选项。

还有其他人遇到这个问题吗?我该如何解决?

最佳答案

如果旧版另存为选项适合您,则您的代码正在解析版本 2 PVR 纹理 header 。最新的 PVRTexTool 和 PVRTexToolCL 均使用版本 3 header 格式 V3。

如果你需要命令行,你可以

A) 使用-pvrlegacy 作为命令行参数

B) 使用 Apple 提供的 texturetool 和 XCode 来压缩你的纹理

C) 更新您的代码以解析版本 3 PVR 纹理 header

版本 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;

版本 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;

如果您希望解析第 3 版纹理 header ,请从以下位置获取 PowerVR SDK:

http://www.imgtec.com/powervr/insider/sdkdownloads/index.asp

并查看 PVRTTexture.h header 。它将具有所有用于定义标志的枚举,以及用于元数据的附加结构。 SDK 中还有读取文件并将其加载到 OpenGL 中的示例代码。

关于ios - pvrtextool cl 不生成标准 header ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9695077/

相关文章:

同一应用的 iOS UUID 不同取决于是否通过 xcode 或 testflight 安装

ios - iOS。 discoverCharacteristics方法调用SIGABRT信号

ios - 在 Swift 中使用 dispatchGroup 处理一系列异步函数时出错

android - 如何将 SurfaceTexture 保存为位图

opengl-es - OpenGL ES 渲染到用户空间内存

iOS 洪水填充 : UIImage vs Core Graphics

c++ - Box2D在特定图层调试绘制

java - OGL ES 2.0 平面纹理

ios - PowerVR GPU 如何提供深度缓冲?

ios - 除了组合器中的前一个和当前纹理单元之外,我还可以引用其他纹理单元吗?