Game Development Community

[iTGB 1.3 beta] I need clear instructions to create PowerVR correctly

by AltiMario · in iTorque 2D · 12/16/2009 (5:14 am) · 8 replies

I've some problems with pvr sheets... and on this forum the informations are not clearly explicated.

Can someone post a clear "manual"?

#1
12/16/2009 (9:59 am)
I think that there is pretty clear information on PVR generation on these forums, so perhaps it would probably be better if you told us what you are trying to do exactly, and what your issues are.

That will probably get you a better response and help you to silve your problems more quickly.
#2
12/16/2009 (1:56 pm)
I found the easiest way to create simple pvr is just to use the mac os texturetool. Found here /Developer/Platforms/iPhoneOS.platform/Developer/user/bin/texturetool.

I copied texturetool and put it in a folder with my images and ran the following command in the Terminal app "texturetool -e PVRTC -o how1.pvr -f PVR how1.png" and it will create a pvr that works with torque. To make your life easier I would recommend making a script to compile your images.

Here is my bash script
#!/bin/bash

cd `dirname "[[628229b920f9c]]"`

echo -n "Converting storyline images"
 /Users/christopherevans/Desktop/ConvertImages/HowToPlayPNG/texturetool -e PVRTC -o how1.pvr -f PVR how1.png
 /Users/christopherevans/Desktop/ConvertImages/HowToPlayPNG/texturetool -e PVRTC -o how2.pvr -f PVR how2.png
 /Users/christopherevans/Desktop/ConvertImages/HowToPlayPNG/texturetool -e PVRTC -o how3.pvr -f PVR how3.png
 /Users/christopherevans/Desktop/ConvertImages/HowToPlayPNG/texturetool -e PVRTC -o how4.pvr -f PVR how4.png
 /Users/christopherevans/Desktop/ConvertImages/HowToPlayPNG/texturetool -e PVRTC -o how5.pvr -f PVR how5.png
 /Users/christopherevans/Desktop/ConvertImages/HowToPlayPNG/texturetool -e PVRTC -o how6.pvr -f PVR how6.png
echo "done."

But reading your post I think you are interested in making PVR for cell-based sprite sheets. I know this is going to be in iTGB 1.3, and from what I gather it is working in the beta; but I have not been able to get this to work. When I created a pvr of my sprite sheet (using the method above) and put it into torque, I get nothing but black.

So the question I have, and I hope its Edoardo also.
Can I just replace the PNG sprite sheets with the PVR version, and it will work? (doesn't look like thats the case)
Do I need to create the PVR's in a special way? (ie set a flag for the command line, for mini mapping or something)
Do I need to set some flag for the datablocks so torque knows its a pvr and to use it as a sprite sheet?

#3
12/16/2009 (2:52 pm)
PVRs work fine for sprite sheets. The easiest way to convert to PVR, imo, is just to use the tool that comes with iTGB. Flip your PNG vertically, convert, and flip the PNG back.

You need to have "optimised=1" set in your datablock for PVR to work properly, I believe.
#4
12/16/2009 (5:08 pm)
Verbose script. Not generic enough ;)

To make it *really* simple to convert many files for many projects, stick your PNGs in one directory and use this:
#!/bin/sh
tt=/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/texturetool


for infile in $@
do
	outfile=${infile%png}pvr # Chop off the suffix and add another
	outfile=`basename $outfile` # Remove path
	$tt -e PVRTC -o pvrdir/$outfile -f PVR $infile
done

Call with something like:
scriptname pngdir/*
#5
12/17/2009 (9:23 am)
Thanks at all....

my problems with tiles! the PVR it's displayed but filterPad don't work.

@Christopher PVR sheets work fine in iTgb 1.3

I've converted my PNG files with Windows (PVRTexTool with GUI)

my steps from PVRTextTool:

1. open a square power of 2 png file with PVRTexToolGUI (Max png dimensions 1024x1024px)

2. preprocess png and check the results.

3. Finally encode with OPENGL ES 1.x
PVRTC 4BPP
PVRTC Iterations: 8
MIP-maps: Image only - no MIP .....

Into datablocks.cs it's obbligatory check optimised ="1" for sheets;




#6
12/17/2009 (9:27 am)
@Chris the operation that you have described it's for Mac? when I compiled with iTgb on Mac the PVR files aren't created.

can you explicate me the steps?
#7
12/17/2009 (4:22 pm)
@Chris thanks I just needed to set optimized flag, and it works. I have a bunch of artifact with my images with transparency, but my other one work well. Thanks

@Ronney your right about my script. After looking at yours and doing some research, I think I made an easier script to use. No command line needed, just drag the exec to where your images are and run. Here is the code
#!/bin/bash

me="$(dirname "[[628229b999a14]]")"
tt=/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/texturetool

echo "Convert All the PNG located in this folder to PVR"

find $me -iname "*.png" | while read file
do
    echo $file
    PNG="$(basename "$file")"
    PVR=${PNG%\.*}".pvr"
    $tt -e PVRTC -o $me/$PVR -f PVR $file
done

echo "Done"


For those how don't know how to make scripts you can download the zip here
#8
12/18/2009 (1:49 pm)
@Edoardo: There's a "tools" folder that comes with iTGB. It's a separate application that converts the images for you in a handy GUI, if you prefer that over a script.

@Christoper - no problem. The sprite that is the "star of the show" in my games is the one I don't convert to PVR due to those same artifact problems.