Is iTGB using my PVR textures.
by Matthew Harris · in iTorque 2D · 05/24/2009 (10:22 pm) · 23 replies
I am familiar with PVRTC compression using the texturetool found in the iphone sdk.
I converted all my textures to PVR, but is it using those textures in my game? Is it still copying my png files in the app?
In other words, does iTGB know the resources you are and aren't using.
- Matt
I converted all my textures to PVR, but is it using those textures in my game? Is it still copying my png files in the app?
In other words, does iTGB know the resources you are and aren't using.
- Matt
#2
iTGB will use the pvr (if it has .pvr extension), the loading order is: check for pvr, then check for rest
05/25/2009 (9:22 am)
Yupp was me who reported the bug.iTGB will use the pvr (if it has .pvr extension), the loading order is: check for pvr, then check for rest
#3
05/25/2009 (11:50 am)
When I tried PVRs with 1.2, I noticed the image was flipped vertically... anyone else notice this? Did I save something wrong?
#4
In the tool folder and then in PVRTC folder there is a readme.
It states
"If you use the GUI tool you may have to pre-invert the image as the GUI tool assumes BMP inverted format, not PNG files."
I guess you have to invert BMP before using them.. i personally use the texturetool through the terminal and only on png files. I hoe this is the cause.
- Matt
05/25/2009 (7:43 pm)
@ChrisIn the tool folder and then in PVRTC folder there is a readme.
It states
"If you use the GUI tool you may have to pre-invert the image as the GUI tool assumes BMP inverted format, not PNG files."
I guess you have to invert BMP before using them.. i personally use the texturetool through the terminal and only on png files. I hoe this is the cause.
- Matt
#5
05/26/2009 (7:25 am)
It should be using PVRs as long as you remove the image extension from the datablock
#6
05/26/2009 (2:34 pm)
if I am on a MAC does it use texturetool automatically or do I need to have the mac prvrtc tool under the tools folder built. I tried building it but... for some reason its missing pvr.cpp and I couldn't find it on my system..
#7
I just used the PVR compression tool from the tools folder GG had. I must say its really nice, lots of options and it previews the pvr.
My only gripe is its not for Mac so I had to switch to a friends comp to use it. It was a hassle but you got to do what you got to do.
I have the PNG files I converted into PVR files all in their respective directories. I wish that when packaging the app for the iPhone it would not transfer the pngs (or other non pvr images) to the iphone project.
Another feature request is for iTGB to know what assets your using so if you have a bunch of textures in a folder, but they aren't say static sprites in iTGB (the builder) then don't include them in the app!
I am still unconvinced that my iTGB app is using PVR files. I know this because with my player sprite there is slight artifacts for pvr and not png. On screen there is no artifacts so I assume its using png still.
05/26/2009 (4:10 pm)
Geoff, remove the extension from the datablock? Where is this...?I just used the PVR compression tool from the tools folder GG had. I must say its really nice, lots of options and it previews the pvr.
My only gripe is its not for Mac so I had to switch to a friends comp to use it. It was a hassle but you got to do what you got to do.
I have the PNG files I converted into PVR files all in their respective directories. I wish that when packaging the app for the iPhone it would not transfer the pngs (or other non pvr images) to the iphone project.
Another feature request is for iTGB to know what assets your using so if you have a bunch of textures in a folder, but they aren't say static sprites in iTGB (the builder) then don't include them in the app!
I am still unconvinced that my iTGB app is using PVR files. I know this because with my player sprite there is slight artifacts for pvr and not png. On screen there is no artifacts so I assume its using png still.
#8
I run my game, was hopping for the best and it threw this error:
source/dgl/gBitmap.h
GBitmap::getWidth mip map level out of range. I couldn't read the numbers associated with this error because I cound't scroll down on the iphone. I believe they are 0, 0.
AssertFatal(in_mipLevel < numMipLevels,
avar("GBitmap::getWidth: mip level out of range: (%d, %d)",
in_mipLevel, numMipLevels));
in_mipLevel, numMipLevels were 0, 0 i believe and it would throw that if they were both 0 because 0 can't be less than 0. I just don't know why.
I used the PVRTC tool that was in the tools folder that came with iTGB the windowsgui one.
All my pngs were converted to 4bpp with all mipmaps PVRTC. I also tried doing it with the top most mipmap only so really no mipmaps. It still throws the error above either case. Please advise.
05/26/2009 (5:16 pm)
I found out that I needed to take off the .png in the datablock.cs under managed folder.I run my game, was hopping for the best and it threw this error:
source/dgl/gBitmap.h
GBitmap::getWidth mip map level out of range. I couldn't read the numbers associated with this error because I cound't scroll down on the iphone. I believe they are 0, 0.
AssertFatal(in_mipLevel < numMipLevels,
avar("GBitmap::getWidth: mip level out of range: (%d, %d)",
in_mipLevel, numMipLevels));
in_mipLevel, numMipLevels were 0, 0 i believe and it would throw that if they were both 0 because 0 can't be less than 0. I just don't know why.
I used the PVRTC tool that was in the tools folder that came with iTGB the windowsgui one.
All my pngs were converted to 4bpp with all mipmaps PVRTC. I also tried doing it with the top most mipmap only so really no mipmaps. It still throws the error above either case. Please advise.
#9
I know some of this has been said in other threads on the forums after doing a little research. I used that PVR plugin tool that works with photoshop. Specified opengl es 1.x, mipmaps, 4bpp on every texture. I still get the crash above.
I do have some textures that are CELL (for animation) but why would that matter?
EDIT:
Well it turns out it does matter for CELL images right now..
I made all my textures with the texture tool in the iphone sdk. I found in another thread thanks to another Matt I believe to use -e PVRTC -o -f PVR (-f PVR is need to make encode with header info, torque needs it)
I am guessing that it couldn't find the width because there was no header info, it defaults to RAW.
Everything is dandy accept the few textures I encoded that have alpha show up kinda weird where their is transparency. It does seem to run faster.
I bet it runs even faster when my cell sheets are PVR (I have 4 1024x1024 sheets with 128x128 cells) mmm Smooth animation.
If anyone knows whats up with alpha/trans please post!
05/26/2009 (7:37 pm)
Not to beat a dead horse.I know some of this has been said in other threads on the forums after doing a little research. I used that PVR plugin tool that works with photoshop. Specified opengl es 1.x, mipmaps, 4bpp on every texture. I still get the crash above.
I do have some textures that are CELL (for animation) but why would that matter?
EDIT:
Well it turns out it does matter for CELL images right now..
I made all my textures with the texture tool in the iphone sdk. I found in another thread thanks to another Matt I believe to use -e PVRTC -o -f PVR (-f PVR is need to make encode with header info, torque needs it)
I am guessing that it couldn't find the width because there was no header info, it defaults to RAW.
Everything is dandy accept the few textures I encoded that have alpha show up kinda weird where their is transparency. It does seem to run faster.
I bet it runs even faster when my cell sheets are PVR (I have 4 1024x1024 sheets with 128x128 cells) mmm Smooth animation.
If anyone knows whats up with alpha/trans please post!
#10
05/27/2009 (3:17 am)
....And that's why I said no PVR doesn't work when you asked the original question. I had hoped to save you some time finding out the hard way ;)
#11
Just not my cell images.
I am thinking of just using a 3d model all together for animations and avoiding sprites.. :P
05/27/2009 (9:34 am)
Peter Dwyer.. PVR does work. I have it working on most of my images.Just not my cell images.
I am thinking of just using a 3d model all together for animations and avoiding sprites.. :P
#12
05/27/2009 (12:14 pm)
do 3d models work with 1.2 now?
#13
I have been spending all day messing with code figuring this out. I am close.
I basically have two TSShapeInstances in the class but for some reason when I load the weapon model its always null before I can render it.
05/27/2009 (10:21 pm)
yeah, t2dShape3D works... I have a 600 poly player with dsq animations and it works fine. My only gripe is that you can't mount a weapon to the player/models mount point. I am not talking about regular 2D mounting, but actually mounting a weapon onto the player.I have been spending all day messing with code figuring this out. I am close.
I basically have two TSShapeInstances in the class but for some reason when I load the weapon model its always null before I can render it.
#14
05/28/2009 (5:31 am)
were 3d models broken in 1.1?
#15
Are you sure you are using PVR for most of your images?
I went through the whole process of converting my images to PVR but, if they aren't power of two, then iTGB was using my png files instead and when I removed the png files all together I got errors.
05/28/2009 (5:57 am)
@MatthewAre you sure you are using PVR for most of your images?
I went through the whole process of converting my images to PVR but, if they aren't power of two, then iTGB was using my png files instead and when I removed the png files all together I got errors.
#16
For the texturetool that came with the iphone sdk do
-e PVRTC -o -f PVR
its important to have the -F PVR flag for header information.
Then go into game->managed->datablocks.cs and delete the .png on all the paths using a find and replace.
I am only using pvr for my player model (t2dshape3d) and my tiles. My hud/ui is pngs.
Hope this helps.
05/28/2009 (2:41 pm)
Yeah... like I said above..For the texturetool that came with the iphone sdk do
-e PVRTC -o -f PVR
its important to have the -F PVR flag for header information.
Then go into game->managed->datablocks.cs and delete the .png on all the paths using a find and replace.
I am only using pvr for my player model (t2dshape3d) and my tiles. My hud/ui is pngs.
Hope this helps.
#18
06/12/2009 (9:23 pm)
I hate having to load Windows in vmware just so i can use the PVR tool. Anyway we can get this to work on the MAC?
#19
06/12/2009 (10:52 pm)
On mac you use the real iphone / Apple tool not the inofficial. The command line is mentioned above for the application
#20
06/15/2009 (4:38 pm)
@Marc how do you preserve transparency with the apple tool? With the windows tool it preserved my transparency, however with the texturetool it's not preserving the transparency.
Torque Owner Peter Dwyer
I think this was raised as a bug by someone, though I have no Idea what the status currently is.