[T2Di 1.3] Large Cell Sheet Fails to Load
by Joe Virgin · in iTorque 2D · 02/08/2010 (6:24 pm) · 7 replies
I have a large cell sheet that is the size 1099x1752, each cell being 157x219. I can implement the sheet in the game builder, but once I put it on the iPhone, I get the following error:
Failed to create imageMap_0, w/h = 2048/2048
It is my understanding that the image is being resized to the next square power of 2. But in previous versions of iTGB, I was able to implement this cell sheet on the phone without problem. Can large cell sheets no longer be used?
Failed to create imageMap_0, w/h = 2048/2048
It is my understanding that the image is being resized to the next square power of 2. But in previous versions of iTGB, I was able to implement this cell sheet on the phone without problem. Can large cell sheets no longer be used?
About the author
Joe Virgin is a programmer for Plainvue Software, Inc., a company producing iPhone games that teach math skills to the youth. Check out Fraction's Kitchen Lite, Fortune's Prime, and Chainshooter powered by iTGB and now available on the App Store.
#2
02/08/2010 (8:00 pm)
The maximum allowed texture size on the iphone is 1024x1024 on pre-3GS devices so you better remain within these restrictions.
#3
That isn't just an iT2D specific thing, but a general knowledge and practice that should be followed in game development the world over.
02/09/2010 (4:10 am)
Please read the docs in regards to Power of 2 images (Best Practices - Torque2D for iPhone.pdf)! That isn't just an iT2D specific thing, but a general knowledge and practice that should be followed in game development the world over.
#4
02/09/2010 (5:42 pm)
Thanks everyone, while I try to maintain the POT rule, the art doesn't always allow it to be applied and I just have to accept padding. I was just hoping that cell images were textured by their cells instead of the entire sheet (though this would probably kill memory through indexing). I'll fix it by slicing the sheet down into smaller subsheets.
#5
so if you get your texture to comply to the maximum allowed size (keep in mind on a pre 3GS the texture you have there without pvr fill over 90% of the available VRAM), you can use the source rect capability to still only have it using a specific subpart.
the sample project that comes with 1.3 shows it in action
02/09/2010 (5:45 pm)
since 1.3 you have the option to specify the texture rect on the texture.so if you get your texture to comply to the maximum allowed size (keep in mind on a pre 3GS the texture you have there without pvr fill over 90% of the available VRAM), you can use the source rect capability to still only have it using a specific subpart.
the sample project that comes with 1.3 shows it in action
#6
02/11/2010 (12:46 pm)
I figured out that it was the optimised flag that was spitting out the error. By turning it off, you can use 2048 x 2048 sheets (at a cost to performance).
#7
Not sure if you really would want to do that.
02/11/2010 (8:14 pm)
it will jsut be split in 4x 1024x1024 on the device at the cost of cutting the possibility of PVR.Not sure if you really would want to do that.
Associate Craig Fortune