Imagination PowerVR SDK Blog

PVRTexToolCL.exe -square + not rounding up.

pvrtextool

#1

I’m using Version 3.40 of PVRTexToolCL, and trying to round my texture size up when using the -square option. There seems to be a bug, and it always rounds it down.



My command is:

pvrtextoolcl -i input.png -o output.pvr -legacypvr -square + -flip y,flag -q pvrtcbest -f PVRTC1_4


#2

Hi Nhyeung,



The square operation is performing correctly as far as I can tell - it’s worth noting that this does option NOT cause the texture to become POT; that is now a separate option: “-pot”. If you want to make your texture a square power of two, you should use the following amended command:



pvrtextoolcl -i input.png -o output.pvr -legacypvr -square + -pot + -flip y,flag -q pvrtcbest -f PVRTC1_4



Regards,

Tobias


#3

Thanks for the reply.



I did a little more testing, and I found the case where it fails. If the png is 512x128, using the -square + option will produce a pvr of size 512x512.



If the png is 128x512, using the same command will give a texture of size 128x128.


#4

Hi Nhyeung,



Yep ok, you’ve definitely found a bug there! Curse my not testing in both directions :slight_smile: I usually do as well… Anyway, figured out the bug - apparently I was checking the maximum against the depth of the texture instead of the height. Whoops. Min works as expected at least. I’ll check in this fix and it will be in the next release. If this is a blocking issue for you, feel free to email DevTech@imgtec.com, and we can send you an engineering drop ahead of time.



Regards,

Tobias


#5

Thanks, but I already implemented a work around this. Glad to be of service.