Pvrtextool cl does not generate standard header
I am using the latest pvrtextoolCL that I downloaded today.
The problem is that it does not create the same header as the apple texturetool, or the one in which it is found in the online documentation. If I use legacy save in gui tool it works, but I need command line tool parameters.
Does anyone else have this problem and what can I do to fix it?
source to share
If the Legacy Save As option works for you, your code is processing the version 2 texture PVR header. The latest PVRTexTool and PVRTexToolCL use the version 3 version 3 header format.
If you want the command line, you can either
A) use -pvrlegacy as command line argument
B) Use the texture tool provided by Apple with Xcode to compress your textures.
C) Update your code to parse the PVD version 3 texture header
Version 2 PVR texture header
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;
Version 3 PVR texture header
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;
If you want to parse the version 3 texture header, go to PowerVR SDK with:
http://www.imgtec.com/powervr/insider/sdkdownloads/index.asp
And look at the header PVRTTexture.h. It will have all enums to define flags and additional structures for metadata. The SDK also has sample code for reading a file and loading it into OpenGL.
source to share