- April 23, 2010 at 4:22 am #30126
Hi,So far I only can load texture from PVR file according to the following API.PVRTTextureLoadFromPVR()Could I load texture from common picture formate such as *jpg, *bmp, *png and so on ?Does anyone have the similiar experience about this question ?Thank for your help.April 23, 2010 at 10:27 am #33876
You can load from other file formats, but you lose any advantages of the different texture formats that OpenGL ES allows you – i.e. everything will be 32bpp RGBA8888 or 24bpp RGB888 which is far from optimal for most situations. Compared this to 2bpp or 4bpp PVRTC, for instance.
The procedure would be:
– open file
– read/decompress data -> RGBA8888
– pass to GL
The only advantage to be gained is in storage size (at least for png and jpg) and these formats can come directly from other sources than PVRTexTool.
All the formats you mention can be converted to .PVR via PVRTexTool and with a little scripting this can be done automatically – see the SDK examples.
Do you have a particular reason that you want to load directly from these formats?April 26, 2010 at 5:03 am #33877
Hi,As you mentioned before,I know that I could convert .PNG (or .JPG) to .PVR via PVRTexTool in the SDK examples.Why do I want to load from these formats(*PNG or *JPG) directly?I would like to load those picture as texture directly.because those picture(*PNG or *JPG) were generated at run time.if I could load picture directly, I will save time.Because I don’t need to spend time converting picture(*PNG or *JPG) to .PVR file.If it’s possible,I want to load picture(*PNG or *JPG) directly.If it is not possible.I only can load PRV file by converting picture to .PVR file.Does anyone have any idea about this question?Thank for your suggestion.April 26, 2010 at 10:45 am #33878April 26, 2010 at 1:25 pm #33879
Hi Gordon,Could I confirm the precdedure?using PVRTexTool v3.10Step1: File–>Open–>image.jpgStep2: Edit–>Encode–>RGB888Does Step 1 map to – open file
Does Step 2 map to – read/decompress data -> RGBA8888
what is pass to GL?Could you please tell me more detail?Thanks for your help.April 26, 2010 at 1:34 pm #33880
Hi,I have read the article ” Load BMP file in runtime” in this forum.it memtions about using DevIL.we could load a .bmp(*jpg or *png) file as texture in runtime without converting into .PVR format.Is the above describtion correct?Or I just misunderstand it.ThanksApril 26, 2010 at 2:00 pm #33881
Hi,on page 6 in the PVRTexTool.Reference Manual.1.11f.External.pdfAn image file of the format (BMP, TGA, GIF, PCX, JPG and PNG). MIP-map information will
be discarded when these formats are chosen â€“ use Save MIP-level from the Edit menu for
this functionality. A decompressed version of the encoded data that will be saved.According to the above step,I would save original bmp as new bmp file.This is what you memtion before.ThanksApril 26, 2010 at 2:40 pm #33882
If you want to use .jpg or .png or other image formats directly on your device then PVRTexTool can’t help you.
You will have to write your own code to read these formats and then load the image data into OpenGL.
The steps I described are the steps that your code would have to perform in order to do this.April 27, 2010 at 3:52 am #33883
Thank you for your explanation.Maybe I don’t express my question clearly.What I want to confirm is that you had posted.PVRTexTool can’t help me to use .jpg or .png or other image formats directly on our device.We have to write our own code to read these formats and then load the image data into OpenGL.Thanks for your suggestion and help.According to your suggestion,I will try it.Thanks.