I have created the pvr file from png file using PVRTexTool but the image is distorted. I have also created the corresponding cpp file using PVRTexTool and it compiles and executes also.
In what way is the image distorted? What are the dimensions of the png file? Which version of PVRTexTool are you using and on what platform?
I’m not sure how you’ve made a cpp file from PVRTexTool as the utility doesn’t produce these - did you use FileWrap?
The content.mak files in the SDK are nmake.exe makefiles that contain paths to the command line version of PVRTexTool and the FileWrap utility - if these are set correctly then the makefiles produce .cpp files. You can alter them to use your own images simply by editing the paths provided to point to your files.Gordon2009-03-03 11:22:58
i am using version 3.7 of PVRTexTool.
Version 3.9 of PVRTexTool is now available from this website and I would recommend that you upgrade to this version.
If you are rebuilding using the Visual Studio project then you’ll need to go to the Content Files/Textures folder in the Solution Explorer and examine the properties for the texture files there: bmp and pvr. They should be using “Custom Build Steps” which call PVRTexTool and FileWrap - it’s here that you can alter the project to use your own textures. The other option is to remove these files from the VS project and force VS to use the .cpp files you’ve generated from content.mak without them being regenerated each time in VS.
Hi Gordon,
As you’ve discovered, the content.mak files will require alterations in order to run with gnu make, but they are very simple files on the whole and this is straightforward to do.
EDIT: So straightforward that alteration is not required in fact, as one of my colleagues has just reminded me…
You can edit the make file directly, but it is far easier to simply add the paths required to the various utilities, either in the makefile itself or on the command line used to call it. For example:
make -f content.mak textures PVRTEXTOOL=…/…/…/Utilities/PVRTexTool/PVRTexToolCL/MacOS/PVRTexTool
Will encode the textures on my iMac here.
Converting the files by hand like you’ve also done should be equivalent to running the makefile, but does take longer for multiple files.
I can’t see anything obviously wrong with the command lines that you’ve used. Which platform and what API are you building for and which version of the SDK are you using? I’m not sure which project you mean when you say “PVRShell Introducing PVRTexTool demo”, can you clarify?
Does the .pvr file that you’ve generated open successfully in PVRTexToolGUI? The error you’re receiving suggests that the file has been opened successfully in the application, but that no valid pvr header has been found, or that the file may be empty. If you’ve built the .cpp files into the application then the .pvr files aren’t required for execution. If you remove them does this make any difference?
Would it be possible for you to send the .pvr file to devtech@imgtec.com for investigation?
Gordon2010-01-08 11:18:04
Hi Gordon, thanks for the reply. :)
Windows often works with both slash characters so I try to use / in preference when I can, but sometimes / can’t be used or an engineer uses anyway, I’m afraid. It’s possible that there’s use of both slashes throughout the content.mak files in the SDK as they are only routinely checked under Windows.
I’m glad you worked out a solution and sorry I was less than clear to start with.