How to create pvr file and corresponding cpp file

This topic contains 8 replies, has 3 voices, and was last updated by  Gordon 7 years, 9 months ago.

Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #29722

    rkaur.s
    Member

    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.

    But is there any way to create pvr and cpp file through content.mak file provided in the SDK
    #32791

    Gordon
    Moderator

    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

    #32792

    rkaur.s
    Member

    i am using version 3.7 of PVRTexTool.

    I saved the texture file as .cpp file using PVRTexTool and it gave the Hex code.

     

    i am working on AlphaBend example and i modified the content.mak ,kept under the path 8_AlphaBlendOGLES2, by including all the required paths.

    But when is clean and rebuild the solution, it doesnot create the required pvr and cpp file.
    #32793

    Gordon
    Moderator

    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.

    #32794

    Aaal Goh
    Member

    Hi Gordon,

     

    I have similar problems with the content.mak file which I am trying to run texture creation PVRShell Introducing PVRTexTool demo.

     

    While I understand nmake is for windows, is there any way that I can make use of the content.mak files to generate the .cpp and .pvr files in Linux?

     

    If not, the only solution is to execute them manually from the PVRTexTool and Filewrap ultilities?

     

    Thanks
    #32795

    Aaal Goh
    Member
    Let me go one more step ahead for question.. in linux env

     

    I have tried creating .pvr file using PVRTexToolCL with the following settings at its command line ->

    ./PVRTexTool -m -fOGLPVRTC4 -i<dir/image filename(tga)> -o<dir/output>

     

    result was successful.

     

    Following that, I went on to create the required .cpp file using Filewrap ->

    ./Filewrap -o <dir/output.cpp> <dir/input (the pvr from above)>

     

    the result was again successful. And so after editing and running the makefile, its relevant .o file is generated too.

     

    Now, while executing from the embedded board, the following error occured:

     

    PVRTTextureLoadPartialFromPointer failed: not a valid pvr

    InitView failed!

    Error: Cannot load the texture

     

    I have checked that the .pvr file is present in the required directory. Do you have any idea what could be wrong in my case?

     

    Thanks a lot in advance for the help.

     

    Aaal Goh wrote:
    Hi Gordon,

     

    I have similar problems with the content.mak file which I am trying to run texture creation PVRShell Introducing PVRTexTool demo.

     

    While I understand nmake is for windows, is there any way that I can make use of the content.mak files to generate the .cpp and .pvr files in Linux?

     

    If not, the only solution is to execute them manually from the PVRTexTool and Filewrap ultilities?

     

    Thanks
    #32796

    Gordon
    Moderator

    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

    #32797

    Aaal Goh
    Member

    Hi Gordon, thanks for the reply. 🙂

     

    First, thanks to your colleague too for suggesting that command make line. I have tried that for PVRTEXTOOL and FILEWRAP and both cases replied “make: Nothing to be done for `textures`.” If simply used ‘make -f content.mak’, it returns “make: ‘all’ is up to date.”

     

    And about the converting of files manually through individual PVRTEXTOOL and FILEWRAP commands, I have tried opening the .pvr files under PVRTexToolGUI program and it opens up fine. So, the problem at this stage is still unknown.

     

    Up to this point, while examining that PVRTEXTOOL line closely, it somewhat reminds me that Linux and Windows folder expression are different. I have seen content.mak executed under the Makefile earlier but didn’t go through the entire file. Hence, I have updated the content.mak file to use “/” instead of “” for both PVRTEXTOOL and FILEWRAP. I don’t presume simply by changing these will solve my problem but wah lah, they actually did! Strange thing is the make process actually allowed the problem to be passed and generated the .pvr and .cpp files.

     

    Thanks Gordon for your hint to the solution 🙂

     

    Platform: ADS5121E Silicon Turkey Express board

    API: Linux, custom

    Version: MPC5121_MBX_OGLES_1_1_SDK for Linux 2.3 (not sure what’s the PVR exact version)
    #32798

    Gordon
    Moderator

    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.

Viewing 9 posts - 1 through 9 (of 9 total)
You must be logged in to reply to this topic.